Python下载网络上一张图片

import requests

path=r"d:\abc.jpg"

url="http://image.nationalgeographic.com.cn/2017/0211/20170211061910157.jpg"

r=requests.get(url)

with open(path,"wb") as f:
f.write(r.content)

猜你喜欢

转载自blog.csdn.net/qqaazzww1234/article/details/80670183