How can we get access in Webkit2 to all WebElements x/y coordinates for a given loaded HTML page. Our problem is that the information we want is in the DOM but the DOM does not seem accessible through the WebKit2 Touch API.
Printable View
How can we get access in Webkit2 to all WebElements x/y coordinates for a given loaded HTML page. Our problem is that the information we want is in the DOM but the DOM does not seem accessible through the WebKit2 Touch API.
i want to known also!
You can try to do this through evaluating custom JavaScript in the context of the web page.
Code:
import QtWebKit 3.0 import QtWebKit.experimental 1.0 WebView { id: webView anchors.fill: parent anchors.margins: 5 onLoadingChanged: { // if loading succeeded, evaluate the script and display its result if (!loading && loadRequest.status === WebView.LoadSucceededStatus) { var script = "(function() { return document.getElementById('text').innerHTML })()" experimental.evaluateJavaScript( input.script, function(result) { console.log( "result=" + result ); } ); }
Cheers,
_