import requests# 网络图片路径为urlurl = 'http://img0.dili360.com/pic/2022/01/12/61de8fb1b209e9394355374_t.jpg' # 指定图片保存位置在F://App Projects//Spider目录下,设置图片文件名为abc.jpgpath = 'F://App Projects//Spider//abc.jpg'# 获取url上的图片r = requests.get(url)# 创建并打开abc.jpg文件,通过r.content写入url上的图片with open(path, 'wb') as file: file.write(r.content)# 关闭文件file.close()