<div><div><pre style="color: rgb(0, 0, 0); font-family: 'Microsoft Yahei', 微软雅黑, verdana; font-size: 16px; word-break: break-word; font-stretch: normal; line-height: 24px; padding: 8px 10px; margin-top: 0px; margin-bottom: 0px;"><span style="font-size: 16px;">That's incredible !</span></pre><pre style="word-break: break-word; font-stretch: normal; padding: 8px 10px; margin-top: 0px; margin-bottom: 0px;"><font face="Microsoft Yahei, 微软雅黑, verdana"><span style="line-height: 24px; font-size: 16px;">I think the the interceptor was used by </span></font><span class="n" style="color: rgb(0, 0, 0); font-family: arial; line-height: normal; font-size: 16px;">profile</span><span class="o" style="color: rgb(102, 102, 102); font-family: arial; line-height: normal; font-size: 16px;">.</span><span class="n" style="color: rgb(0, 0, 0); font-family: arial; line-height: normal; font-size: 16px;">setRequestInterceptor(WebEngineUrlRequestInterceptor())</span><font face="Microsoft Yahei, 微软雅黑, verdana"><span style="line-height: 24px; font-size: 16px;">, so it more or less was referenced by the </span></font><span style="color: rgb(0, 0, 0); font-family: arial; line-height: normal; font-size: 16px;">profile, and it on earth was</span><span style="color: rgb(0, 0, 0); font-family: arial; line-height: 23.8px; font-size: 16px;"> garbage collected later, that just sounds </span><span style="font-size: 16px;">ridiculous!</span></pre><pre style="word-break: break-word; font-stretch: normal; padding: 8px 10px; margin-top: 0px; margin-bottom: 0px;"><span style="font-size: 16px;">Please help explain more, thanks !</span></pre></div><div style="color: rgb(0, 0, 0); font-family: arial; font-size: 14px;"><br></div><div style="color: rgb(0, 0, 0); font-family: arial; font-size: 14px;"><br></div><div style="color: rgb(0, 0, 0); font-family: arial; font-size: 14px;"><br></div></div><!-- jy5ContentSuffix --><div>在2016年07月03 05时59分, "Phil Thompson"<phil@riverbankcomputing.com>写道:</div><blockquote id="isReplyContent" style="padding-left:1ex; margin: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"><br><br>> On 2 Jul 2016, at 2:46 am, redstone-cold <<a href="mailto:redstone-cold@163.com">redstone-cold@163.com</a>> wrote:<br>> <br>> someone says  It may be caused by python garbage collection<br>> http://stackoverflow.com/questions/37658772/pyqt5-6-interceptrequest-doesnt-work<br>> <br>> P.S. I tried the solution , it worked . but I cannot figure out why, can you explain it ?<br><br>setRequestInterceptor() doesn't take ownership of the interceptor and you aren't keeping a reference (either implicit or explicit) to it so it gets garbage collected.<br><br>Phil<br><br>> 在2016年07月02 05时03分, "Florian Bruhin"<<a href="mailto:me@the-compiler.org">me@the-compiler.org</a>>写道:<br>> <br>> * redstone-cold <<a href="mailto:redstone-cold@163.com">redstone-cold@163.com</a>> [2016-06-30 13:16:48 +0800]:<br>> > In my project, there is some need to get a certain requested URL in Chrome Dev Tools by Python during loading a web page,<br>> > <br>> > I think get the URL by Qt WebEngine is a good solution. I started by trying to use the code below to print out all the requested URLs during loading a web page, <br>> > <br>> > my code here https://bpaste.net/show/f2b1b67bdf96<br>> > <br>> > but it didn't work - no URL get printed at all , so what's wrong here ? Any good solutions ?<br>> <br>> I finally got around to updating to Qt 5.7 and trying this, and it<br>> doesn't work here either.<br>> <br>> I really can't see why, it seems to me like it should work... did you<br>> find out anything in the meantime?<br>> <br>> Florian<br>> <br>> -- <br>> http://www.the-compiler.org | <a href="mailto:me@the-compiler.org">me@the-compiler.org</a> (Mail/XMPP)<br>>   GPG: 916E B0C8 FD55 A072 | http://the-compiler.org/pubkey.asc<br>>         I love long mails! | http://email.is-not-s.ms/<br>> <br>> <br>>  <br>> _______________________________________________<br>> PyQt mailing list    <a href="mailto:PyQt@riverbankcomputing.com">PyQt@riverbankcomputing.com</a><br>> https://www.riverbankcomputing.com/mailman/listinfo/pyqt<br><br></blockquote>