爬取一张图片

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:纯文本格式

posted @ 2024-02-23 18:01  会秃头的小白  阅读(20)  评论(0编辑  收藏  举报