Working with PhantomJS

Now, let's see how PhantomJS's magic works. It is a command-line-based application, so we need to execute it in an OS terminal or console. The PhantomJS package contains a series of files and comes with one main executable file, which is named phantomjs.

Open your terminal and then navigate to your PhantomJS bin folder. In the prompt, execute phantomjs without any arguments.

Tip

PhantomJS Windows build

In Windows build, PhantomJS executable can be found in the root folder with the filename phantomjs.exe.

Working with PhantomJS

Running PhantomJS without any arguments will give you an interactive prompt that is similar to the JavaScript debug console ...

Get Getting Started with PhantomJS now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.