python3的requests模块下载图片到本地

版权声明:版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/z564359805/article/details/81978913
import requests
# 图片地址
url = 'http://www.open-open.com/bbs/uploadImg/20160107/20160107133856_341.jpg'
html = requests.get(url)
# 将图片保存到D盘
with open("D:/1.jpg","wb")as f:
    f.write(html.content)

猜你喜欢

转载自blog.csdn.net/z564359805/article/details/81978913
今日推荐