代码如下:
#爬取图片import requestsurl='http://5b0988e595225.cdn.sohucs.com/images/20190613/12831466b3bc413f8bd0064de0651878.jpeg'
path='../picture/爱迪奥特曼.jpg'try:r=requests.get(url)f=open(path,'wb')f.write(r.content) #将二进制文件写入f.close()except:print('爬取失败!')
效果如下: