Hi !
I am usign QWebPage to parse an online page and to use its data in my application. It works great but I have a few questions for enhancements :
- How could I handle 404 error page. I can't find anything to analyse the request received from the server when using a QWebPage
- Is there a specific signal for timeout or do I just wait for loadFinished signal to be emitted with a QTime chrono ?
- I have tested my application on a network with a proxy. Here is the code of my proxy handling :
QNetworkAccessManager *manager = page->networkAccessManager();
proxy->setHostName("cache");
proxy->setPort(3128);
manager->setProxy(*proxy);
QNetworkAccessManager *manager = page->networkAccessManager();
QNetworkProxy *proxy = new QNetworkProxy();
proxy->setHostName("cache");
proxy->setPort(3128);
proxy->setType(QNetworkProxy::HttpProxy);
manager->setProxy(*proxy);
To copy to clipboard, switch view to plain text mode
It works but fails randomly on loading some files, and if I use a QWebView it seems that loadfinished is never emitted. I don't know if it is specific to this proxy or if using a proxy requires a particular way of loading pages (such like a pause between each url load) but the same code without proxy manager works great on my computer, directly connected to the internet. So I wonder if it is possible to handle error and maybe response from the proxy.
Thanks a lot
Bookmarks