python requests 保存图片

 

html = requests.get('https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1490350083846&di=01e5ca0ce5499719c43f5d1e9f75d8c9&imgtype=0&src=http%3A%2F%2Fwww.th7.cn%2Fd%2Ffile%2Fp%2F2016%2F05%2F03%2F9e9ce32b8128ad84229ccc69f8c2e6c9.jpg')
with open('picture.jpg', 'wb') as file:
    file.write(html.content)

 

参考:
https://blog.csdn.net/sinat_21302587/article/details/65634124
https://blog.csdn.net/qq_39620871/article/details/80732521
https://blog.csdn.net/weixin_40267472/article/details/81384624
https://blog.csdn.net/Mind_programmonkey/article/details/89705569
https://blog.csdn.net/Mind_programmonkey/article/details/89705820

转载于:https://www.cnblogs.com/sea-stream/p/11530633.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值