URLError: <urlopen error [Errno 11001] getaddrinfo failed>

Gisle Vanem gisle.vanem at gmail.com
Sun Feb 13 02:45:55 EST 2022


Shaozhong SHI wrote:

> The following is used in a loop to get response code for each url.
> 
> print (urllib.request.urlopen(url).getcode())
> 
> However, error message says: URLError: <urlopen error [Errno 11001]

11001 == WSAHOST_NOT_FOUND.

Look in any 'winsock.h' header:
   #define WSAHOST_NOT_FOUND (WSABASEERR+1001)

-- 
--gv


More information about the Python-list mailing list