I set up PhantomJS and recorded it to video: https://www.dailymotion.com/video/xnizmh_1_webcam
Build instructions: http://phantomjs.org/build.html
Is there anything wrong in my setup?
After I set it up I read the quick start tutorial and tried to write this code
phantomjs hello.js
It gives me "command not found" error. How can I solve this problem?
See link Installation guide is in ...
And run in terminal with this command
You can get up and running without
sudo
ornpm
. Simply download, extract, and add to path.This has the added advantage of easy backup if you are in the habit of backing up your entire home folder which I highly recommend. This also works with any version of Linux.
The disadvantages are:
You could use a very simple shell script for installing/upgrading
Or in a Dockerfile
If you want to use phantomjs easily, you can use it at phantomjscloud.com You can get the result just by http request.
For Ubuntu you can use the prebuilt versions downloadable from the PhantomJS site.
If you have some serious time on your hands you can also build it yourself. (This is exactly the procedure from Nikhil's answer).
The guys over at PhantomJS recommend using the binaries to save time:
With a modern machine they mean > 4 cores, > 8gb mem I think. I tried it on a micro AWS instance and gave up after 2 hours.
In short: install the prebuilt packages from the PhantomJS site per their instructions.
Installation and Calling Phantomjs
Follow the steps doesn't work, but cloned from others built. (ver2.0)
This is how I place a specific version of phantomjs in /usr/local/bin on my docker containers.
or with out
./
depending on OS.