Python urllib.request.urlopen() returning error 10061?

后端 未结 2 651
情书的邮戳
情书的邮戳 2020-12-18 08:11

I\'m trying to download the HTML of a page (http://www.google.com in this case) but I\'m getting back an error. Here is my interactive prompt session:



        
2条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-18 08:34

    urllib takes the proxy settings from Internet Explorer, which is usually under Tools->Internet Options->Connections->Lan Settings

    If you have a proxy, make sure it's correct in IE, or set it when using urllib. If you don't use a proxy to browse, make sure that the proxy settings in IE are empty.

    I was struggling with this issue few hours until I realized that a 3rd party app I once installed changed the setting in IE, while i was surfing happily in Firefox without a proxy.


    Another solution is in the this link which shows how to force urllib to ignore IE's proxy settings

提交回复
热议问题