当前位置:网站首页>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 server is running with the --super-read-only option
MotionLayout的使用
a标签下载图片,不要预览
CSDN21天学习挑战赛——day1 正则表达式大总结
DropBlock: Regularization method and reproduction code for convolutional layers
ERROR 2003 (HY000) Can‘t connect to MySQL server on ‘localhost3306‘ (10061)解决办法
专属程序员的浪漫七夕
HbuilderX 启动微信小程序 无法打开项目
专题讲座7 计算几何 学习心得
matlab封闭曲线拟合 (针对一些列离散点)
MySQL面试题大全(陆续更新)
数据特征预处理——缺失值的查看方式及处理
缓存穿透、击穿、雪崩
MySQL错误-this is incompatible with sql_mode=only_full_group_by完美解决方案
中职网络安全竞赛C模块MS17-010批量扫描
MySQL内存淘汰策略
串口监听 - 软件方案
Base64编码原理
【字符串】最小表示法
秒杀系统设计









