当前位置:网站首页>data:image/jpg; base64 format data is converted to image
data:image/jpg; base64 format data is converted to image
2022-08-04 07:32:00 【Simon's knife】
When crawling pictures, I found that some picture urls start with "data:image/jpg;base64", such as the picture below
At this point, after obtaining the url, you need to decrypt the url with base64, and the decrypted data can be written into the picture, see the code below for details
img_imf = img_imf.replace('data:image/jpg;base64,','')#Convert data:image/jpg;base64 format data into picturespage_content = base64.b64decode(img_imf)file_path = './code.jpg'with open(file_path, 'wb') as f:f.write(page_content)
边栏推荐
猜你喜欢
随机推荐
mysql基础(4)
TypeScript基本类型、类、封装、继承、泛型、接口、命名空间
LeetCode(剑指 Offer)- 18. 删除链表的节点
MySQL错误-this is incompatible with sql_mode=only_full_group_by完美解决方案
详解CAN总线:常用CAN连接器的使用方法
设置el-table自动向下滑动(不多解释,直接代码实现)
七牛云上传图片和本地上传
【深度学习实践(二)】上手手写数字识别
C语言实现-华为太空人手表
秒杀系统设计
类图规范总结
两日总结六
idea使用@Autowired注解爆红原因及解决方法
【字符串】最小表示法
中断和异常的处理与抢占式多任务
舍不得花钱买1stOpt,不妨试试这款免费的拟合优化神器【openLU】
卷积神经网络CNN
关于我写的循环遍历
SystemVerilog-条件(三元)运算符
MMDeploy部署实战系列【第二章】:mmdeploy安装及环境搭建