import requests
respone = requests.get("https://img.meituan.net/avatar/677432d318b33f80840614344355418c96270.jpg@100w_100h_1e_1c")
with open('./1.jpeg','wb') as file:
file.write(respone.content)
图片是以二进制存储的,提交get请求,将二进制写入img文件。
respone.text() 返回Unicode编码的数据
respone.content() 返回bite类型的数据