I use QWebView to load a page, then I only keep reloading it with reload()slot. loadFinished(bool) signal often undicates false. I also use QwebView's network access manager's finished signal to get http response code - it's set to 0.
The same page loads fine with all browsers, no matter how fast I try to relaod it in browser. How to debug this problem, what could be wrong?
Add a comment
|
1 Answer
Have you tried to get the reply's error code and error message, like this:
class Browser(object):
def __init__(self):
self.network_manager = QNetworkAccessManager()
self.network_manager.finished.connect(self._request_finished)
self.web_page = QWebPage()
self.web_page.setNetworkAccessManager(self.network_manager)
self.web_view = QWebView()
self.web_view.setPage(self.web_page)
def _request_finished(self, reply):
print reply.error()
print reply.errorString()
2 Comments
andrean
At which point are you hitting the reload function, after a loadFinished is emitted, or just continuously, no matter the page is loaded or not ? If that's the case, that should be the reason why you got an OperationCanceledError.
Violet Giraffe
I got it, thanks! I'm reloading the page on timer and I don't check whether previous load has completed or not.