QWebView Extract Information
I have a QWebView that loads a page that has some javascript which modifies the document on the fly. AKA:
Code:
document.getElementByID("displayWindow").innerHTML = "Somegeneratedtext";
Is there a way to for my Qt program to look at the modified page, and capture this changed text in say, a QString, perhaps like QTextCursor?
Re: QWebView Extract Information
From what it looks like, I could use QWebPage * page () to get the page, then QWebFrame * currentFrame () to get the singular frame that appears.
From there I can use QVariant evaluateJavaScript ( const QString & scriptSource ) to "inject" a script that will check the innerhtml, or i could use toHtml () or toPlainText () and parse out the pieces of the web page that I was interested in.
Does this sound like the right direction to go? or is there an easier way?
Re: QWebView Extract Information
For now there is no direct access to page's DOM tree, so you have to use JavaScript.