下载一只猫的图片(其中500和600可以替换成其他的数字)

import urllib.request
reponse = urllib.request.urlopen('http://placekitten.com/g/500/600')
cat_img = reponse.read()
with open('E:图片cat_500_600.jpg','wb') as f:
f.write(cat_img)
print('success')

原文地址:https://www.cnblogs.com/nnty/p/9927147.html