fun=re.search(r'(__=\([\S\s]*?;)<',r_text).group(1)
fun=fun+'function get(){return JSON.stringify(__.data)}'
ctx = execjs.compile(fun)
rdata = (ctx.eval('get()'))
报错 json.decoder.JSONDecodeError: Expecting value: line 1 column 85 (char 84)
解决:
方式一:不建议,因为会影响后面打包成执行程序
点击1处进入subprocess.py文件
把encoding=None 改成encoding=‘utf-8’
方式二:
# **********放在execjs模块之前,解决execjs执行js产生的乱码报错************
import subprocess
from functools import partial
subprocess.Popen = partial(subprocess.Popen, encoding='utf-8')
import execjs
源引自与参考:https://www.cnblogs.com/yusilu-2653144/p/16626661.html,标签:encoding,Python,JSONDecodeError,subprocess,char,报错,fun,execjs From: https://www.cnblogs.com/chenyun-delft3d/p/17289141.html