karthik A
karthik A

Reputation: 655

urllib2.urlopen('ur') gives error

I am new to python and trying to extract the contents of a page. When I do urlopen('http://www.google.com'), I get the following error :

File "<stdin>", line 1, in <module>    
  File "/usr/lib/python2.7/urllib2.py", line 126, in urlopen
    return _opener.open(url, data, timeout)
  File "/usr/lib/python2.7/urllib2.py", line 391, in open
    response = self._open(req, data)
  File "/usr/lib/python2.7/urllib2.py", line 409, in _open
    '_open', req)
  File "/usr/lib/python2.7/urllib2.py", line 369, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.7/urllib2.py", line 1185, in http_open
    return self.do_open(httplib.HTTPConnection, req)
  File "/usr/lib/python2.7/urllib2.py", line 1160, in do_open
    raise URLError(err)

Any solutions to this ?

Upvotes: 0

Views: 658

Answers (1)

boltsfrombluesky
boltsfrombluesky

Reputation: 422

that error message occurs if your net is offline

Upvotes: 3

Related Questions