How to change PhantomJS version

亡梦爱人 提交于 2019-11-29 18:07:26

This message is shown if you try to use PhantomJS 2.x with a CasperJS version <= 1.1-beta.

use different PhantomJS once

If you also have PhantomJS 1.x on your system, you can simply change the executable like this in the command prompt.

cmd.exe:

C:\path> set PHANTOMJS_EXECUTABLE=C:\path\to\phantomjs198.exe

C:\path> casperjs script.js

terminal:

$ export PHANTOMJS_EXECUTABLE=/path/to/phantomjs198
$ casperjs script.js

You can also use "phantomjs198" instead of "/path/to/phantomjs198" if it is in PATH.

Update CasperJS

The other way would be to use the CasperJS from the master branch on GitHub (docs). It works rather well in my experience and supports PhantomJS 2.x (and PhantomJS 1.x).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!