Skip to content

Commit 9176b0a

Browse files
authored
Merge pull request #6 from Shun2014/patch-1
必应每日一图 url 更新
2 parents 96781c7 + 3e43e3d commit 9176b0a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

biyingSpider.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@
55
url = 'http://cn.bing.com/'
66
con = requests.get(url)
77
content = con.text
8-
reg = r"(http://s.cn.bing.net/az/hprichbg/rb/.*?.jpg)"
8+
reg = r"(az/hprichbg/rb/.*?.jpg)"
99
a = re.findall(reg, content, re.S)[0]
1010
print(a)
11-
read = requests.get(a)
11+
picUrl = url + a
12+
read = requests.get(picUrl)
1213
f = open('%s.jpg' % local, 'wb')
1314
f.write(read.content)
1415
f.close()

0 commit comments

Comments
 (0)