In Python, urllib2 giving error

Posted by pythBegin on Stack Overflow See other posts from Stack Overflow or by pythBegin
Published on 2010-05-12T10:58:36Z Indexed on 2010/05/12 11:04 UTC
Read the original article Hit count: 347

Filed under:
|
|

I tried running this,

>>> urllib2.urlopen('http://tycho.usno.navy.mil/cgi-bin/timer.pl')

But it is giving error like this, can anyone tell me a solution ?

Traceback (most recent call last):
  File "<pyshell#11>", line 1, in <module>
    urllib2.urlopen('http://tycho.usno.navy.mil/cgi-bin/timer.pl')
  File "C:\Python26\lib\urllib2.py", line 126, in urlopen
    return _opener.open(url, data, timeout)
  File "C:\Python26\lib\urllib2.py", line 391, in open
    response = self._open(req, data)
  File "C:\Python26\lib\urllib2.py", line 409, in _open
    '_open', req)
  File "C:\Python26\lib\urllib2.py", line 369, in _call_chain
    result = func(*args)
  File "C:\Python26\lib\urllib2.py", line 1161, in http_open
    return self.do_open(httplib.HTTPConnection, req)
  File "C:\Python26\lib\urllib2.py", line 1136, in do_open
    raise URLError(err)
URLError: <urlopen error [Errno 11001] getaddrinfo failed>

© Stack Overflow or respective owner

Related posts about python

Related posts about urllib2