Open a URL and read a web page
import urllib
pagehandler = urllib.urlopen("http://www.google.com")
outputfile = open("index.html", "wb")
while 1:
data = pagehandler.read(512)
if not data:
break
outputfile.write(data)
outputfile.close()
pagehandler.close()
Related examples in the same category