socket.gaierror from httplib

S

Steve Holden

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:

regards
Steve
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top