import requests
imgUrl = 'http://img3m0.ddimg.cn/9/25/1674043380-1_b_1.jpg'
headers = {
'User-Agent': 'Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Mobile Safari/537.36'
}
res = requests.get(imgUrl, headers=headers).content
print(res)
name = '3'
with open(name + '.jpg', 'wb') as f:
f.write(res)
python爬虫通过图片网址保存图片
最新推荐文章于 2024-05-01 14:20:05 发布