Interpreting Javascript from Python
Interpreting Javascript from Python
我希望能够解释或编译Javascript文件,从Python程序中捕获错误等。Javascript 文件使用以下语法,例如:
var a;
function Mul (){
prompt(b);
document.write(a*b);
}
我尝试使用SpiderMonkey,但它似乎无法解释"提示","document.write"等。
像document.write
这样的东西不能工作,因为SpiderMonkey不是浏览器。所以没有文档,也没有 DOM。 同样,您没有窗口,因此没有警报或提示。所有这些在命令行脚本中都没有多大意义......
你可以在Python中构建自己的DOM解析器(假设你实际上有一个网页要解析),并自己创建一个document
对象,但这可能是很多工作,回报很少。
相关文章:
- 从桌面读取python文件时高亮显示代码
- python-selenium-点击上升链接
- python到“;流“;字典处理
- 什么's本地node.js服务器和python简单http服务器之间的区别
- Meteor如何运行服务器端python脚本
- Validate JSON from Mongo?
- 回调函数在python代码中离线
- 将数组从ajax传递到python(Tornado)
- Get JSON from an url
- 为什么在python中使用异常比javascript更容易接受
- creating objects from variables ES6
- getting id from jsp
- 如何让Meteor应用程序使用python脚本写入数据库
- jquery使用name from变量按类选择元素
- Interpreting Javascript from Python
- Call python from javascript
- Access getEventListeners from chrome webdriver (python)
- Call python FUNCTION from javascript
- Call Javascript from python
- angularJS & web2py: calling python from ng/javascript/ht