Download from a website : Web Page « Network « Python






Download from a website

Download from a website

# Download Example

import urllib, sys

f = urllib.urlopen("http://www.java2s.com")
while 1:
    buf = f.read(2048)
    if not len(buf):
        break
    sys.stdout.write(buf)

           
       








Related examples in the same category

1.Obtain Web Page Information
2.Extract list of URLs in a web pageExtract list of URLs in a web page