1 import urllib.request as ur 2 response = ur.urlopen(‘http://img.zcool.cn/community/0142135541fe180000019ae9b8cf86.jpg@1280w_1l_2o_100sh.png‘) 3 cat_img = response.read() 4 with open(‘kang.png‘,‘wb‘) as f: 5 f.write(cat_img)
简单爬图片,功能需增强
标签:img col res request unit mmu com span urlopen
1 import urllib.request as ur 2 response = ur.urlopen(‘http://img.zcool.cn/community/0142135541fe180000019ae9b8cf86.jpg@1280w_1l_2o_100sh.png‘) 3 cat_img = response.read() 4 with open(‘kang.png‘,‘wb‘) as f: 5 f.write(cat_img)
简单爬图片,功能需增强
标签:img col res request unit mmu com span urlopen
原文地址:https://www.cnblogs.com/kangdong/p/8485208.html