Environment: Windows 7, Phantomjs version 1.8.0.
I try to run any .js file from 'examples' folder, installed Phantom.js before, added path to the PATH variable, checked version like
phantomjs --version
and it works.
But when I try to run
phantomjs examples/version.js
then get 'Can't open version.js'
I've checked file security settings and run cmd like administrator, but still the same result.
I'll appreciate any help to solve this issue. Thanks in advance.
For Windows Download the zip file, unpack it and you will get an executable phantom.exe. Set the PATH environment variable to the path of phantom.exe file. Open a new command prompt and type phantomjs –v. It should give you the current version of PhantomJS that is running.
Open a new browser tab and return to the debugging portal at http://127.0.0.1:9000. There should now be a second entry in the bulleted list. Click on this entry to open a new debugger that operates in the context of your page inside PhantomJS.
PhantomJS is a discontinued headless browser used for automating web page interaction. PhantomJS provides a JavaScript API enabling automated navigation, screenshots, user behavior and assertions making it a common tool used to run browser-based unit tests in a headless system like a continuous integration environment.
Was having the same trouble. Finally solved it by specifying absolute path to phatnomjs executable.
instead of:
phantomjs myjsfile.js
do:
/my/absolute/path/to/phantomjs/phantomjs myjsfile.js
I suspect setting up PATH to it will have the same effect, have not tested it though.
In my case,
/mypath/phantomjs /mypath/myfile.js
It takes three days for finding this out. Pretty wired syntax to me.
If it doesn't work then use . in front of first /
./mypath/phantomjs ./mypath/myfile.js
. means base dir as you set in the R studio
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With