Can not get urllib.urlopen to work

Pater Maximus emayo at home.com
Fri Oct 29 13:35:23 EDT 2004


Problem solved!!

First, thanks to all who responded.

It turns out the villain was "Norton Personal Firewall". Since it did not
warn me that it was blocking an attempt to reach the internet, I assumed it
was not the problem.

Bad assumption.

Everything worked when I configured Norton to allow pythonw.exe to contact
the internet.


"Pater Maximus" <emayo at home.com> wrote in message
news:3JKdnSvPhssyduLcRVn-sg at comcast.com...
> I am trying to implement the recipe listed at
> http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/211886
>
> However, I can not get to first base. When I try to run
>
> import urllib
> fo=urllib.urlopen("http://www.dictionary.com/")
> page = fo.read()
>
> I get:
>
> Traceback (most recent call last):
>   File "C:/Program Files/Python/Lib/idlelib/testurl", line 2,
in -toplevel-
>     fo=urllib.urlopen("http://www.dictionary.com/")
>   File "C:\PROGRA~1\PYTHON\lib\urllib.py", line 76, in urlopen
>     return opener.open(url)
>   File "C:\PROGRA~1\PYTHON\lib\urllib.py", line 181, in open
>     return getattr(self, name)(url)
>   File "C:\PROGRA~1\PYTHON\lib\urllib.py", line 297, in open_http
>     h.endheaders()
>   File "C:\PROGRA~1\PYTHON\lib\httplib.py", line 712, in endheaders
>     self._send_output()
>   File "C:\PROGRA~1\PYTHON\lib\httplib.py", line 597, in _send_output
>     self.send(msg)
>   File "C:\PROGRA~1\PYTHON\lib\httplib.py", line 564, in send
>     self.connect()
>   File "C:\PROGRA~1\PYTHON\lib\httplib.py", line 548, in connect
>     raise socket.error, msg
> IOError: [Errno socket error] (10061, 'Connection refused')
>
>





More information about the Python-list mailing list