标签:des style http io ar color os sp java
python 抓取每日一文文章
import urllib2
# get webpage
headers = {‘User-Agent‘:‘Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.101 Safari/537.36‘}
fd = urllib2.Request(‘http://meiriyiwen.com/‘,headers = headers)
data = urllib2.urlopen(fd).read()
# save as a file
f = open(‘issue.htm‘, ‘w‘)
f.write(data)
f.close()
标签:des style http io ar color os sp java
原文地址:http://www.cnblogs.com/logri/p/4120330.html