Waiting for a website to load completely with WebKitGTK+ [duplicate]

♀尐吖头ヾ 提交于 2019-12-06 11:08:23

There is no sure way to programatically accomplish that task for all websites, as there are pages where those redirections are initiated with javascript, often started by setTimeout after n-seconds, and there is no built-in method to scan for such "quirks". However if you are parsing a known group of websites, where you surely know that such redirections will happen, you can create a list of those urls with the required number of seconds after which the redirection will happen. After an initial loadFinished is fired, you can start a QTimer, connect it's signal to a function which will fire loadFinished again, so the next page load will surely start while you're waiting for the result. Wait for the page result until there are no new loadStarted signals fired and no redirection needs to be done again.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!