url updated

old one not work
pull/6/head
Shun Li 2018-02-13 09:02:17 +08:00 committed by GitHub
parent 936b39b8fd
commit 3e43e3d9c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -5,10 +5,11 @@ local = time.strftime("%Y.%m.%d")
url = 'http://cn.bing.com/' url = 'http://cn.bing.com/'
con = requests.get(url) con = requests.get(url)
content = con.text content = con.text
reg = r"(http://s.cn.bing.net/az/hprichbg/rb/.*?.jpg)" reg = r"(az/hprichbg/rb/.*?.jpg)"
a = re.findall(reg, content, re.S)[0] a = re.findall(reg, content, re.S)[0]
print(a) print(a)
read = requests.get(a) picUrl = url + a
read = requests.get(picUrl)
f = open('%s.jpg' % local, 'wb') f = open('%s.jpg' % local, 'wb')
f.write(read.content) f.write(read.content)
f.close() f.close()