python打开url并按指定快大写读取网页内容
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()