Hi all<br><br>I have written a small code snippet to open a URL using urllib2 to open a web page , my python version is 2.4 but i get an urlopen error called connection timed out<br><br>The following is the code snippet<br>
<br><i>import urllib2<br><br>f = urllib2.urlopen('<a href="http://www.google.com/">http://www.google.com/</a>')<br>print f.read(100)</i><br><br><br>where as the same url <a href="http://www.google.com/">http://www.google.com/</a> works through my browser.<br>
<br>The following is the back trace :<br><br>File "test_url.py", line 3, in ?<br>    f = urllib2.urlopen('<a href="http://www.google.com/">http://www.google.com/</a>')<br>  File "/usr/lib/python2.4/urllib2.py", line 130, in urlopen<br>
    return _opener.open(url, data)<br>  File "/usr/lib/python2.4/urllib2.py", line 358, in open<br>    response = self._open(req, data)<br>  File "/usr/lib/python2.4/urllib2.py", line 376, in _open<br>
    '_open', req)<br>  File "/usr/lib/python2.4/urllib2.py", line 337, in _call_chain<br>    result = func(*args)<br>  File "/usr/lib/python2.4/urllib2.py", line 1021, in http_open<br>    return self.do_open(httplib.HTTPConnection, req)<br>
  File "/usr/lib/python2.4/urllib2.py", line 996, in do_open<br>    raise URLError(err)<br><b>urllib2.URLError: <urlopen error (110, 'Connection timed out</b>')><br><br><br>Any pointers in this regard will be of great help.<br>
<br>Thanking you'll in advance.<br><br>Regards,<br>sv<br><br><br>