[Interest] FW: QWebview signals with dynamic web pages
Murphy, Sean M.
sean.murphy at gd-ais.com
Thu Mar 1 18:40:28 CET 2012
Forwarding back to the list
> Try to see in the page's source if there is a <script> element.
> Another tip: try Firefox + Firebug to debug the sensors web page and find out how it updates the on-screen values.
>> I'm trying to read an 8-channel temperature sensor device that outputs its data via a web interface. Viewing the
>> device's web page via a normal web browser, or via QWebView::load(), I can see the temperatures correctly. The
>> temperature values are "live" in that they automatically update about once a second, without the user having to
>> manually reload/refresh the browser. My HTML skills are pretty minimal, so I'm not sure what magic it uses to
>> update those parameters, but I don't see any sort of <meta http-equiv="refresh" content="1"> tag.
>> What I want to do is parse the HTML that comes back from the device and just grab the temperatures so that I can
>> timestamp them and log them to a file. So I've got code that does the parsing correctly. I've connected that code
>> up to the QWebView::loadFinished(bool) signal, but that only causes my parsing code to get triggered once, only when
>> my initial QWebView::load() finishes.
>> Is there some sort of signal that I can connect to in the QWeb* hierarchy that will get triggered everytime the
>> device's web page updates itself via whatever magic it's using? I've tried QWebView::loadFinished() and
>> QWebPage::contentsChanged() / QWebPage::loadFinished() and QWebFrame::pageChanged / QWebFrame::loadFinished(), but
>> no of those seem to get triggered.
>> I know I could just set up a QTimer and explicitly call QWebView::load() on my own, but that seems overkill, not to
>> mention it's going to make the web page have to redraw which looks ugly to the user.
Interest mailing list
Interest at qt-project.org
More information about the Interest