urllib.error.URLError:

后端 未结 2 1787
难免孤独
难免孤独 2020-12-21 09:58

So, My code is only 4 lines. I am trying to connect to a website, what I am trying to do after that is irrelevant because the error arised without the other codes.

2条回答
  •  醉酒成梦
    2020-12-21 10:47

    This means that either your DNS system is not working correctly, or you have to use a proxy on your network and it isn't defined correctly.

    If you need to use a proxy, set the environment variable HTTP_PROXY (and optionally, HTTPS_PROXY) to the correct configuration for your network. The format is http://proxy.example.com:80; if your proxy needs a username and password, you should pass it in, like this: http://username:password@proxy.example.com:80.

    For DNS issues, try looking up the domain from the command line. Open a command prompt and type nslookup python-data.dr-chuck.net and see if it returns to you an IP address.

提交回复
热议问题