凌的博客

您现在的位置是:首页  > 学无止境 > python

python

python 抓取网页

2015-05-17python0
import urllib.request res = urllib.request.urlopen(\"http://www.yetyun.com\") content = res.read().decode(\"utf-8\") t = open(\"test.html\",\"w\",encoding=\'utf-8\') print(content,file=t) t.close()
import urllib.request
res = urllib.request.urlopen("http://www.yetyun.com")
content = res.read().decode("utf-8")
t = open("test.html","w",encoding='utf-8')
print(content,file=t)
t.close()

如果本文对您有所帮助,请支持下本站哦!!!^_^

文章评论

0条评论