You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import requests
import os
url = "http://image.ngchina.com.cn/userpic/99679/2019/0615113404996793383.jpeg"
root = "D://pics//"
path = root + url.split('/')[-1]
try:
if not os.path.exists(root):
os.mkdir(root)
if not os.path.exists(path):
r = requests.get(url)
with open(path,'wb') as f :
f.write(r.content)
f.close()
print("文件保存成功")
else:
print("文件已存在")
except:
print("爬取失败")
Requests库
京东
亚马逊
百度
360
图片爬取
IP地址归属地
参考
https://www.cnblogs.com/zhaof/tag/%E7%88%AC%E8%99%AB/
The text was updated successfully, but these errors were encountered: