Qt QWebElement - parsing document (parser doesn't see some elements)
I'm trying to parse source code from : http://panoramafirm.pl/szukaj/mazowi...a/firmy,1.html
There is 15 elements with class="table". I'm trying to get them using this code :
Code:
QWebPage page;
QWebFrame * frame = page.mainFrame();
frame->setHtml(str);
QWebElement document = frame->documentElement();
QWebElementCollection tables = document.findAll(".table");
int numTables = tables.count();
qDebug() << numTables;
return;
In str variable is html code of site that i've downloaded before with qnetwork manager.
This code shows me "0", but there is 15 elements with table class.
My code was working a few days ago, but I think that site was changed, and now my code is not working ;(
Can you help me solve my problem ?
Re: Qt QWebElement - parsing document (parser doesn't see some elements)
I have the same problem.
Does anybody have an idea how to solve?
Re: Qt QWebElement - parsing document (parser doesn't see some elements)
The original post's HTML (assuming it has not changed in structure since 2012) contains no elements with a class of "table". This explains no results from the search.
We have no idea what your page is, what you are searching for, or how you are looking for it. Assuming your code is not fundamentally broken then we can only assume that the HTML document contains nothing that matches what you are looking for. It could be that what you are searching for is actually the content of a child iframe or dynamically generated/loaded using AJAX or similar.