PyQt4.QtWebKit: QWebPage QWebView set timeout when load stop
문제
Is there any way to say to a QWebPage or to a QWebView stop loading page if some sort of timeout is exceeded?
Sultan
해결책
CutyCapt uses QTWebKit and it has a max-wait parameter. You should take a look at how they do it. It should have something to do with QTimer.
다른 팁
I have had exactly the same problem with my page scraping app that would sometimes take too long on certain JavaScript calls.
In my app I add a single shot timer that on expiry calls a method "as if" the page has finished loading like this:
self.timer = QTimer()
self.timer.singleShot(15000, self.finished_loading)
You can see the whole source on my GitHub.
제휴하지 않습니다 StackOverflow