I am actually writing a code to check whether the links are direct or error or redirect or file download link
when i write these lines
import urllib2
response = urllib2.urlopen('http://google.com')
I get error as follows:
Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
response = urllib2.urlopen('http://google.com')
File "C:\Python27\lib\urllib2.py", line 126, in urlopen
return _opener.open(url, data, timeout)
File "C:\Python27\lib\urllib2.py", line 391, in open
response = self._open(req, data)
File "C:\Python27\lib\urllib2.py", line 409, in _open
'_open', req)
File "C:\Python27\lib\urllib2.py", line 369, in _call_chain
result = func(*args)
File "C:\Python27\lib\urllib2.py", line 1173, in http_open
return self.do_open(httplib.HTTPConnection, req)
File "C:\Python27\lib\urllib2.py", line 1148, in do_open
raise URLError(err)
URLError: <urlopen error [Errno 11004] getaddrinfo failed>
Y is this error occuring any ideas?? Is this because my company doenst allow to access websites this way?Thanks