8000 添加必应 · PythonDemoOrg/PythonBaseSample@ac0db3b · GitHub
[go: up one dir, main page]

Skip to content

Commit ac0db3b

Browse files
committed
添加必应
1 parent 9e94add commit ac0db3b

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import requests
2+
import re
3+
import time
4+
local = time.strftime("%Y.%m.%d")
5+
url = 'https://cn.bing.com/'
6+
con = requests.get(url)
7+
content = con.text
8+
reg = r"(http://s.cn.bing.net/az/hprichbg/rb/.*?.jpg)"
9+
a = re.findall(reg, content, re.S)[0]
10+
print(a)
11+
read = requests.get(a)
12+
f = open('%s.jpg' % local, 'wb')
13+
f.write(read.content)
14+
f.close()

0 commit comments

Comments
 (0)
0