Ok,
So I took another route:
QVariant listOfImages
= webView.
page()->mainFrame
()->evaluateJavaScript
("document.getElementsByTagName(\"img\").length;");
double numberOfImages = listOfImages.toDouble();
QVariant listOfImages = webView.page()->mainFrame()->evaluateJavaScript("document.getElementsByTagName(\"img\").length;");
double numberOfImages = listOfImages.toDouble();
To copy to clipboard, switch view to plain text mode
then:
for (double i = 0; i < numberOfImages; ++i)
{
srcOfImages
= webView.
page()->mainFrame
()->evaluateJavaScript
(QString("document.getElementsByTagName(\"img\")[%1].src;").
arg(i
));
imageUrl = srcOfImages.toString();
}
for (double i = 0; i < numberOfImages; ++i)
{
srcOfImages = webView.page()->mainFrame()->evaluateJavaScript(QString("document.getElementsByTagName(\"img\")[%1].src;").arg(i));
imageUrl = srcOfImages.toString();
}
To copy to clipboard, switch view to plain text mode
Job done.
Bookmarks