Python爬虫三
Posted hhh江月
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Python爬虫三相关的知识,希望对你有一定的参考价值。
Python爬虫三
import requests
"""
a picture
"""
url = "https://tse1-mm.cn.bing.net/th/id/R-C.6ec4d1779202538cc345b75bf51681da?rik=Xo5KuGF1r3%2bd%2bA&riu=http%3a%2f%2fimg95.699pic.com%2fphoto%2f40083%2f1074.jpg_wh860.jpg&ehk=EjMY0wV6agZsqYNBKY1Y3NAi9fUiF2hrkPhLFsKIqKc%3d&risl=&pid=ImgRaw&r=0"
headers =
"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (Khtml, like Gecko) Chrome/97.0.4692.99 Safari/537.36 Edg/97.0.1072.69"
res = requests.get(url=url, headers=headers)
print(res)
with open(" test1.jpg", "wb") as f:
f.write(res.content)
f.close()
以上是关于Python爬虫三的主要内容,如果未能解决你的问题,请参考以下文章