python保存base64图片

import base64
import re

request_base64='''   '''
imgdata = base64.b64decode(request_base64)

with open("imageToSave.png","wb") as fh:
    fh.write(imgdata)
imgData = re.sub('^data:image/.+;base64,', '', request_base64)

一定要去掉data:image/jpg:base64,。切记切记

你可能感兴趣的:(自学爬虫,python,开发语言)