urllib2.URLError:

前端 未结 6 1159
小蘑菇
小蘑菇 2020-11-30 09:10

If I run:

urllib2.urlopen(\'http://google.com\')

even if I use another url, I get the same error.

I\'m pretty sure there is no fire

6条回答
  •  误落风尘
    2020-11-30 09:39

    The site's DNS record is such that Python fails the DNS lookup in a peculiar way: it finds the entry, but zero associated IP addresses. (Verify with nslookup.) Hence, 11004, WSANO_DATA.

    Prefix the site with 'www.' and try the request again. (Use nslookup to verify that its result is different, too.)

    This fails essentially the same way with the Python Requests module:

    requests.exceptions.ConnectionError: HTTPConnectionPool(host='...', port=80): Max retries exceeded with url: / (Caused by : [Errno 11004] getaddrinfo failed)

提交回复
热议问题