import requests print(requests.get('http://pic1.win4000.com/wallpaper/2018-03-20/5ab0bf15b4681.jpg').content)#抓取图片把text换成content with open('004.jpg','wb')as f:#w+ :检测文件不存在,自动创建,encoding解码 f.write(response)