import urllib.request
req=urllib.request.Request('http://placekitten.com/g/500/600')
response=urllib.request.urlopen(req)
cat_img=response.read()
with open('cat_500_600.jpg','wb') as f:
f.write(cat_img)
response.geturl()
inf=response.info()
print(inf)
response.getcode()
python3.0学习二 下载图片
最新推荐文章于 2024-07-22 06:34:43 发布