[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
> As far as I can understand from your explanation I think the sensor's values are update by Javascript.
> 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.
Yes, there is definitely javascript involved. There are few lines like:
<script src="webtemp.js" type="text/javascript"></script>
So unfortunately I can't see the actual javascript code directly in the HTML. I'll see if I can get Firebug up and running, but even if I do, will that actually help? Is there any signal that gets fired off as javascript functions get evaluated?
Sean
>> 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
http://lists.qt-project.org/mailman/listinfo/interest
More information about the Interest
mailing list