当前位置:网站首页>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锁机制
分布式计算MapReduce | Spark实验
轻量化Backbone VGNetG成就“不做选择,全都要”轻量化主干网络
MySQL内存淘汰策略
国内外知名源码商城系统盘点
pycharm专业版使用
app逆向1某联
带你了解一下PHP搭建的电商商城系统
10个程序员可以接私活的平台和一些建议,赚麻...
MySQL面试题大全(陆续更新)
创建数据库报错--MySQL server is running with the --super-read-only option
在线问题反馈模块实战(十八):实现excel台账文件记录批量导入功能
JVM 快速检测死锁
最强分布式锁工具:Redisson
FCN - the originator of semantic segmentation (based on tf-Kersa reproduction code)
函数柯里化详解
分布式计算实验3 基于PRC的书籍信息管理系统
异常值 识别与处理方法
缓存穿透、击穿、雪崩









