[Tutor] HTTP file download

Jean-Philippe Durand yaguarovi at gmail.com
Tue Mar 13 13:23:44 CET 2007


Hello Ronaldo,
Try this :

import urllib
mysock = urllib.urlopen("http://www.somesite.com/file")
htmlSource = mysock.read()
mysock.close()
print htmlSource

Regards.
Jean-Philippe DURAND


2007/3/13, ronaldo at netf2r.com <ronaldo at netf2r.com>:
>
> Hello all,
>
> How can I download a file using HTTP?
> For example:
> There is a file at: http://www.somesite.com/file. I need to get this file
> using HTTP from a python script.
> I'm not sure but I think httplib could be used to do that.
> Can anyone confirm that? or Can anyone suggest me something else?
>
> Thank you?
>
> --
> Ronaldo Z. Afonso
> Phone: 55+11+82619082
> www.netf2r.com
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20070313/431c5867/attachment.htm 


More information about the Tutor mailing list