Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
N
network-assets-reptile
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liyang
network-assets-reptile
Commits
d01ae530
Commit
d01ae530
authored
Jul 25, 2023
by
liyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:ins爬虫数据条件过滤优化
parent
2ffcf5d2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
0 deletions
+3
-0
download_image.py
utils/download_image.py
+3
-0
No files found.
utils/download_image.py
View file @
d01ae530
import
requests
import
os
def
download_image
(
url
,
save_path
):
"""
下载图片并保存到本地文件
...
...
@@ -12,7 +13,9 @@ def download_image(url, save_path):
if
os
.
path
.
exists
(
save_path
):
# print(f"图片文件已存在:{save_path}")
return
True
response
=
requests
.
get
(
url
,
stream
=
True
)
if
response
.
status_code
==
200
:
with
open
(
save_path
,
'wb'
)
as
file
:
for
chunk
in
response
.
iter_content
(
1024
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment