PDA

View Full Version : [SOLVED] Always empty QWebPage



Guilo
30th December 2009, 16:56
Hi !

I am trying to parse an html file with qwebelement. But when loading the qwebpage and selecting the mainframe from it, it doesn't contain anything :


QWebPage *page = new QWebPage();

page->mainFrame()->load(QUrl("http://guilo19.free.fr/HD/column.html"));


QWebFrame *frame = page->mainFrame();

std::cout<<frame->toHtml().toStdString();

QWebElement document = frame->documentElement();
std::cout << document.toOuterXml().toStdString() <<"\n";
std::cout << "voila";

I have already tried to show a qwebiew and the page did load fine.

Thanks

tsp
30th December 2009, 17:10
Edit: deleted ...

Guilo
30th December 2009, 17:32
QWebPage has loadFinished() signal. I have tried it and it works really great. Thanks. I first tried to use Sleep() so as to test but didn't seem to work.