[EMAIL PROTECTED] wrote:
> this code
> 
>     h=httplib.HTTPConnection('euronext.com')
>     h.request('GET',
> 'http://www.euronext.com/home/0,3766,1732,00.html')
> 
> fails with this message
> 
>       File "httplib.py", line 532, in connect
>         socket.SOCK_STREAM):
>     socket.gaierror: (-2, 'Name or service not known')
> 
> what am i doing wrong?
> 
> thanks
> eric
> 
The HTTPConnection specifies the server you are connection to (you only 
give to domain, which isn't guaranteed to resolve to the same IP 
address, or indeed even any IP address).

Having connected, all you need to present in the request() method call 
is the HTTP method and the URI relative to the server. This works for me:

  >>> import httplib; h=httplib.HTTPConnection('www.euronext.com')
  >>> h.request('GET','/home/0,3766,1732,00.html')
  >>>

regards
  Steve
-- 
Steve Holden       +44 150 684 7255  +1 800 494 3119
Holden Web LLC             http://www.holdenweb.com/

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to