http request doesn't work!

bart3rNOSPAM at clinicdesignNOSPAM.com.au bart3rNOSPAM at clinicdesignNOSPAM.com.au
Fri Mar 26 04:58:50 CET 2004


Could someone please let me know what i'm doing wrong here:


#!/usr/bin/python

import httplib

WEB_SITE = 'adsl.internode.on.net'
#WEB_SITE = 'www.google.com'
#PAGE_PATH = '/about.html'
PAGE_PATH = '/htm/un-metered-sites-ip-list.htm'
http = httplib.HTTP(WEB_SITE)
http.putrequest('GET', PAGE_PATH)
http.putheader('Accept', 'text/html')
http.putheader('Accept', 'text/plan')
http.endheaders()
httpcode, httpmsg, headers = http.getreply()
print 'msg: ' + httpmsg
print httpcode
doc = http.getfile()
data = doc.read()
doc.close()
print data




The output of the above is different if you go to the following in
your browser:
http://adsl.internode.on.net/htm/un-metered-sites-ip-list.htm


Whats my problem?!?!??!



More information about the Python-list mailing list