For example if I have a QWebView:
QString webhtml
= webView
->page
()->currentFrame
()->toHtml
();
QString webhtml = webView->page()->currentFrame()->toHtml();
To copy to clipboard, switch view to plain text mode
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:
javascript
= QString("javasciptfunctiontoexecute()");
QVariant javascriptreturnvalue
= webView
->page
()->currentFrame
()->evaluateJavaScript
(javascript
);
dosomethinginQt(javascriptreturnvalue.toString());
javascript = QString("javasciptfunctiontoexecute()");
QVariant javascriptreturnvalue = webView->page()->currentFrame()->evaluateJavaScript(javascript);
dosomethinginQt(javascriptreturnvalue.toString());
To copy to clipboard, switch view to plain text mode
Bookmarks