import requests
url = 'https://q2.itc.cn/images01/20240806/dc8bfc5d0e53494ea5bbe057df7bd5c2.jpeg'
headers = {
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36 Edg/130.0.0.0'
}
res = requests.get(url=url, headers=headers)
print(res.status_code)
with open("蔡卓妍.jpg", 'wb') as f:
f.write(res.content)
print("图片下载完成!")
手机浏览器打开百度搜索图片,点击打开图片,长按选择分享图片,复制链接,这个链接地址就是图片地址。
https://q2.itc.cn/images01/20240806/dc8bfc5d0e53494ea5bbe057df7bd5c2.jpeg
jpg分享图片→复制链接
https://img1.baidu.com/it/u=3965187982,1856960934&fm=253&fmt=auto&app=138&f=GIF?w=603&h=471
分享图片→复制链接
https://img-blog.csdnimg.cn/20200222220034367.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L1dZQ1dMTVk=,size_16,color_FFFFFF,t_70
直升飞机gif
长按图片→分享图片→复制链接
https://pic.rmb.bdstatic.com/bjh/250325/dump/0f916517a7d9e33a374b932c6f6a7276.gif
猫咪科目三
https://q2.itc.cn/q_70/images03/20240127/6bcdd1b24f9a4edca1f04aa969a68ee6.gif