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(WE B_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:
Whats my problem?!?!??!
#!/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(WE B_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:
Whats my problem?!?!??!
Comment