FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
Python/biyingSpider.py at master · JavaCoderFan/Python · GitHub
JavaCoderFan
Python
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
Python
/
biyingSpider.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
15 lines (15 loc) · 334 Bytes
Breadcrumbs
Python
/
biyingSpider.py
Copy path
File metadata and controls
15 lines (15 loc) · 334 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import
requests
import
re
import
time
local
=
time
.
strftime
(
"%Y.%m.%d"
)
url
=
'http://cn.bing.com/'
con
=
requests
.
get
(
url
)
content
=
con
.
text
reg
=
r"(az/hprichbg/rb/.*?.jpg)"
a
=
re
.
findall
(
reg
,
content
,
re
.
S
)[
0
]
print
(
a
)
picUrl
=
url
+
a
read
=
requests
.
get
(
picUrl
)
f
=
open
(
'%s.jpg'
%
local
,
'wb'
)
f
.
write
(
read
.
content
)
f
.
close
()
Back
|
FazBrowse Home
|
New Git URL