python爬取单张图片

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_20025577/article/details/81173592
import urllib.request
response = urllib.request.urlopen("http://pic36.photophoto.cn/20150728/0022005597823716_b.jpg")  #图片地址
cat_img = response.read()
with open('D:/python/summer/images/cat.jpg','wb') as f:   #保存路径
    f.write(cat_img)
        

猜你喜欢

转载自blog.csdn.net/qq_20025577/article/details/81173592