Download file from web site
Thomas Pham
tdpham at email.com
Tue Dec 4 00:03:13 EST 2001
Hi group,
I am trying to download a file from a website. My source code is listed below. But I can only get to its first page. I could not go further to its second page. The second page "idm_download" however, does require an user ID & password to open it.
Thanks,
Thomas
#!/usr/local/bin/python
import httplib
h = httplib.HTTP('www.teamidm.com/idm_download/')
h.putrequest('GET', '/index.html')
h.putheader('Accept', 'text/html')
h.putheader('Accept', 'text/plain')
h.endheaders()
errcode, errmsg, headers = h.getreply()
print errcode
f = h.getfile()
data = f.read()
print data
f.close()
--
_______________________________________________
1 cent a minute calls anywhere in the U.S.!
http://www.getpennytalk.com/cgi-bin/adforward.cgi?p_key=RG9853KJ&url=http://www.getpennytalk.com
More information about the Python-list
mailing list