当前位置:网站首页>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)边栏推荐
猜你喜欢
随机推荐
Centos通过Docker搭建MySQL的PXC集群
分布式计算MapReduce | Spark实验
MotionLayout的使用
DropBlock: Regularization method and reproduction code for convolutional layers
七牛云上传图片和本地上传
Amazon亚马逊 Vendor Central Label详解
两日总结七
adb无法桥接夜神模拟器
FCN - the originator of semantic segmentation (based on tf-Kersa reproduction code)
idea使用@Autowired注解爆红原因及解决方法
如何画好业务架构图。
unicloud 腾讯云 上传文件 Have no access right to the storage uniapp
串口监听 - 软件方案
零分贝超静音无线鼠标!数量有限!!先到先得!!!【元旦专享】
科研绘图图表类型种类繁多,本文告诉你如何选择!
最强分布式锁工具:Redisson
90多款matlab工具箱打包放送
JVM 快速检测死锁
用手机也能轻松玩转MATLAB编程
TCP协议详解









