将javascript文本解析为数组
我在js中有以下代码:将javascript文本解析为数组,javascript,parsing,Javascript,Parsing,我在js中有以下代码: var poly_line_offset_f5 = L.polyline( [[41.716111, 20.722361], [41.7704754, 20.8381323]], {"bubblingMouseEvents": true, "color": "#FFA500", "dashArray": "", "dashOffset":
var poly_line_offset_f5 = L.polyline(
[[41.716111, 20.722361], [41.7704754, 20.8381323]],
{"bubblingMouseEvents": true, "color": "#FFA500", "dashArray": "", "dashOffset": null}
).addTo(feature_group_Under110kVLines);
var popup_6cc = L.popup({"maxWidth": "100%"});
var html_a1 = $(' <div id="html_a1" </div> ')[0];
popup_6cc.setContent(html_a1);
poly_line_offset_f5.bindPopup(popup_6cc)
;
poly_line_offset_f5.bindTooltip(
'<div> VLKIJ_VRUGHTK_4_95: </div>',
{"sticky": true}
);
popup_6cc
:
var dict bind
popup_6cc {"maxWidth": "100%"} html_a1
html\u a1
:
var text
html_a1 ' <div id="html_a1" </div> '
var文本
html_a1'研究如何使用esprima
。这是PyPi
示例代码:
from esprima import parseScript
with open("file.js", "r") as file:
string = file.read()
script = parseScript(string)
print(script)
不确定您是否可以完成所需的一切,但它可以为您提供变量及其值。请将所有文本显示为文本,而不是文本图片。
from esprima import parseScript
with open("file.js", "r") as file:
string = file.read()
script = parseScript(string)
print(script)