爬取一张图片
import requests
if __name__ == '__main__':
url = 'https://5b0988e595225.cdn.sohucs.com/images/20200102/59a5cc9a208249c6b4a58a8287f50485.jpeg'
img_data = requests.get(url=url).content
with open("./qiutu.jpg",'wb') as fp:
fp.write(img_data)
content:二进制
json:json格式
text:纯文本格式