naraka
import requests
path = "D:/abc/123.jpg" #设置图片文件路径,前提是必须要有abc这个文件夹
url = \'https://car3.autoimg.cn/cardfs/product/g24/M09/2C/2A/1024x0_1_q87_autohomecar__ChcCL1rd66CAbLHHAAvLMUvSlTU844.jpg\'
r = requests.request(\'get\',url) #获取网页
print(r.status_code)
with open(path,\'wb\') as f: #打开写入到path路径里-二进制文件,返回的句柄名为f
f.write(r.content) #往f里写入r对象的二进制文件
f.close()

分类:

技术点:

相关文章:

  • 2021-12-10
  • 2021-11-23
  • 2021-05-22
  • 2021-05-25
  • 2021-12-08
  • 2022-12-23
  • 2021-12-10
  • 2021-11-18
猜你喜欢
  • 2021-11-30
  • 2021-11-26
  • 2021-12-10
  • 2021-11-23
  • 2021-11-24
  • 2022-01-01
  • 2021-11-30
相关资源
相似解决方案