Skip to main content

PhantomJS v2 some useful commands

As we already know PhantonJS is a browser with no graphical interface used for the automation of web page interaction.

Here are some command that will help us configure our browser more efficiently according to our needs.



Prints warning and debug message, the default value is false.
It will help us with possible faults you have, errors of JavasSript, libraries, classes, and much more.



Ignore SSL errors, such as expired or self-signed certificate errors, default false.
Very useful if we have problems with certificates with false we can avoid some headaches.



Load all images online, the default is true.
With false we can avoid loading, not always, unnecessary images.



Specifies a JSON-formatted configuration file.
We can specify different configurations according to our needs.

Example of custom configuration for our environment:

  "ignoreSslErrors": true,

  "outputEncoding": "utf8",


  /*Load images*/



PhantonJS API