摘要:
#-------PYTHON获取网页内容-------------#import sys, urlliburl = "http://www.baidu.com" #网页地址wp = urllib.urlopen(url) #打开连接content = wp.read() #获取页面内容fp = open("web.txt","w") #打开一个文本文件fp.write(content) #写入数据fp.close() #关闭文件注意:如果报错你就把所有的注释去掉就可以 如果你在有什么疑问和建议请加QQ群181537678 以供交流 阅读全文