代码 import requests # 明确目标url url = "https://img-blog.csdnimg.cn/20190927163801418.png" # 发起get请求得到响应对象 response = requests.get(url) # 拿到响应的内容,以bytes类型拿 con = response.content print(type(con), con) # 保存文件 with open('jt.png', "wb") as f: f.write(con) 结果