爬虫的自我修养2
import urllib.requestresponse = urllib.request.urlopen('http://placekitten.com/g/500/600')
cat_img = response.read()
with open('cat_500_600.jpg', 'wb') as f:
f.write(cat_img)
抓猫图片,但是我电脑上并没有得到该图片 代码是没有问题的
你应该去你代码所在的文件夹下寻找
默认路径是和.py文件一起的 新人报到进来看看
页:
[1]