QtWebKit access HTML manipulated by javascript
hi there,
I want to build a WebKit app that loads a webpage, allows the user to interact with the webpage, and then saves the current HTML of the webpage.
If the webpage HTML is manipulated with JavaScript, is there a way to access the updated HTML? Or only the original HTML source?
thanks,
Richard
Re: QtWebKit access HTML manipulated by javascript
For example if I have a QWebView:
Code:
QString webhtml
= webView
->page
()->currentFrame
()->toHtml
();
if this is executed after the javascript modifies the page, then the modified html will be in the string.
You can also use javascript in the page like this:
Code:
javascript
= QString("javasciptfunctiontoexecute()");
QVariant javascriptreturnvalue
= webView
->page
()->currentFrame
()->evaluateJavaScript
(javascript
);
dosomethinginQt(javascriptreturnvalue.toString());