时间:2021-07-01 10:21:17 帮助过:76人阅读
import urllib
pagehandler = urllib.urlopen("http://www.baidu.com")
outputfile = open("index.html", "wb")
while 1:
data = pagehandler.read(512)
if not data:
break
outputfile.write(data)
outputfile.close()
pagehandler.close()
希望本文所述对大家的Python程序设计有所帮助。