【发布时间】:2013-05-06 02:11:29
【问题描述】:
我正在学习pyqt,用于解析网页。
现在我想使用 pyqt 评估 javascript 函数,就像这个答案一样: spidermonkey evaluate js function which in remote js file
import urllib2
import spidermonkey
js = spidermonkey.Runtime()
js_ctx = js.new_context()
script = urllib2.urlopen('http://etherhack.co.uk/hashing/whirlpool/js/whirlpool.js').read()
js_ctx.eval_script(script)
js_ctx.eval_script('var s = "abc"')
js_ctx.eval_script('print(HexWhirlpool(s))')
我想知道如何使用 pyqt 而不是 spidermonkey 来达到同样的效果。
【问题讨论】:
-
请更具体地说明您想要实现的目标,如果可能,请在您的帖子中添加一些示例代码
标签: javascript python pyqt spidermonkey