Skip to content

Commit 3e43e3d

Browse files
authored
url updated
old one not work
1 parent 936b39b commit 3e43e3d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

biyingSpider.py

+3-2
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)