Hi,
I need to get the whole web page content after receiving loadFinished() signal for that URL. I need to store the web page content in a string or a file and then use it to access some elements from the web page.
I have researched about this and tried:
QNetworkAccessManager manager;
QNetworkReply
*response
= manager.
get(QNetworkRequest
(QUrl(url
)));
connect(response,SIGNAL(finished()),&event,SLOT(quit()));
event.exec();
QString html
= response
->readAll
();
// Source should be stored here
QNetworkAccessManager manager;
QNetworkReply *response = manager.get(QNetworkRequest(QUrl(url)));
QEventLoop event;
connect(response,SIGNAL(finished()),&event,SLOT(quit()));
event.exec();
QString html = response->readAll(); // Source should be stored here
To copy to clipboard, switch view to plain text mode
But the string 'html' comes out as empty. Could anyone please help in this ? Maybe some alternate way to get the content ?
Bookmarks