当前位置:网站首页>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)边栏推荐
猜你喜欢
随机推荐
系统流量预估、架构设计方案
国内外知名源码商城系统盘点
MMDeploy部署实战系列【第三章】:MMdeploy pytorch模型转换onnx,tensorrt
NelSon:一款新的适配matlab编程语法的编程工具
Verilog“七宗罪”
curl (7) Failed connect to localhost8080; Connection refused
SystemVerilog-条件(三元)运算符
七牛云上传图片和本地上传
数据特征预处理——缺失值的查看方式及处理
DropBlock: Regularization method and reproduction code for convolutional layers
如何用matlab做高精度计算?【第三辑】(完)
CSRF和SSRF漏洞
创建数据库报错--MySQL server is running with the --super-read-only option
舍不得花钱买1stOpt,不妨试试这款免费的拟合优化神器【openLU】
力扣每日一题-第47天-15. 三数之和
原型图总结规范
Redis非关系型数据库
app逆向1某联
【字符串】最小表示法
微信小程序实现活动倒计时









