[英]Do I need to use WebSockets to interface node.js with PhantomJS?
I couldn't find it referenced in the documentation but since PhantomJs is now at 2.1, Is there a way to use a WebSocket to interface NodeJs and PhantomJs directly or am I better going with StdIn/StdOut? 我在文档中找不到引用,但由于PhantomJs现在为2.1,是否可以使用WebSocket直接连接NodeJs和PhantomJs,还是最好使用StdIn / StdOut?
I'd like to skip the step of spawning a webserver plus a fake webpage to catch the events like I've seen on many github. 我想跳过生成网络服务器和伪造网页的步骤,以捕获类似我在许多github上看到的事件。 If I can I would avoid those ninja tricks.
如果可以的话,我会避免那些忍者把戏。
You really don't need WebSockets or the Web Server module. 您确实不需要WebSockets或Web Server模块。
There are basically two ways to use PhantomJS from node.js: 从node.js使用PhantomJS基本上有两种方法:
Write a plain PhantomJS script and spawn a PhantomJS process that executes that script, but this doesn't provide easy interactivity 编写一个普通的PhantomJS脚本并生成一个执行该脚本的PhantomJS进程,但这不能提供轻松的交互性
Interface with PhantomJS through the many available bridges so that you can mix PhantomJS code with node.js code: 通过许多可用的桥与PhantomJS进行接口,以便您可以将PhantomJS代码与node.js代码混合使用:
phantom , node-phantom , nightmare (version <1.8 used PhantomJS, now it's Electron), Horseman , navit , phridge , node-phantom-simple , jquery.go.js , SpookyJS (wrapper around CasperJS, which is a wrapper around PhantomJS), Selenium-Webdriver (JavaScript bindings), webdriver.io (other JS bindings for Selenium), etc. phantom , node-phantom , 噩梦 (版本<1.8使用PhantomJS,现在是Electron), Horseman , navit , phridge , node-phantom-simple , jquery.go.js , SpookyJS (CasperJS的包装器,是PhantomJS的包装器) , Selenium-Webdriver (JavaScript绑定), webdriver.io (Selenium的其他JS绑定)等。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.