Bottom Page

Thread Rating:
  • 1 Vote(s) - 2 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 [Errno11004] Get addrinfo failed with urlopen
#1
Hello All,

I'm new to python development and using python version Python 2.7.13 , basically im trying to open a url but I get an error. Please supoort me on what the issue here is.
Code Snippet:
import urllib2
response = urllib2.urlopen('python.org') (I have removed the http link intenationally since i was not allowed to post the link)
Issue:
.......
 File "C:\Python27\lib\urllib2.py", line 1198, in do_open
   raise URLError(err)
URLError: <urlopen error [Errno 11004] getaddrinfo failed>

Thanks!
Prashanth
Quote
#2
Here's the source: https://github.com/python/cpython/blob/2...2.py#L1196
Here's a description of the Window's Socket Error: https://msdn.microsoft.com/en-us/library...WSANO_DATA

The error is unrelated to urllib2, and is a socket error.  That error indicates that dns returned a result, but that there's no ip addresses associated with it.  Try again with 'www.' in front, or with a protocol.  
OR: check if you're using a proxy (environment variable http_proxy or https_proxy), and either stop using it, or start using a different one.

Also, the requests module is much easier to work with than urllib2 (but that's beside the point).
Quote
#3
same problem for me when the network is down.
Quote

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  SSLCertVerificationError using urllib (urlopen) FalseFact 1 701 Mar-31-2019, 08:34 AM
Last Post: snippsat
  Error: module 'urllib' has no attribute 'urlopen' mitmit293 2 2,183 Jan-29-2019, 02:32 PM
Last Post: snippsat
  urllib request urlopen? nutgut 4 1,827 Apr-14-2018, 01:12 PM
Last Post: nutgut
  urllib urlopen getting error 400 on 1 specific page glidecode 4 932 Mar-01-2018, 11:01 PM
Last Post: glidecode
  urllib2.urlopen() user agent header Skaperen 8 6,920 Jul-14-2017, 05:36 PM
Last Post: nilamo

Forum Jump:


Users browsing this thread: 1 Guest(s)