How to load a nodejs module in PyV8?

前端 未结 1 477
清歌不尽
清歌不尽 2021-01-24 01:24

How can I load a nodejs module in PyV8?

I\'ve read all about how great jsdom is when run with nodejs. Will I get the same dom-traversing benefits if I run v8 inside a Py

相关标签:
1条回答
  • 2021-01-24 01:48

    I'm afraid this isn't possible as jsdom requires some node constructs which are not available under vanilla v8. Things like require, core libraries, and the method of sandboxing a window would take a bit of work to pull out of jsdom.

    You may want to take a peek at https://github.com/andreasgal/dom.js/

    0 讨论(0)
提交回复
热议问题