O'Reilly logo

PhantomJS Cookbook by Rob Friesel

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Debugging a PhantomJS script

In this recipe, we will learn about remote debugging PhantomJS scripts using the remote-debugger-port and remote-debugger-autorun command-line arguments.

Getting ready

To run this recipe, we will need the following:

  • PhantomJS installed on our PATH
  • A script to run with PhantomJS, which we are interested in debugging
  • Our computer's IP address
  • An open port over which the debugger will communicate
  • Another browser such as Google Chrome or Safari

The script in this recipe is available in the downloadable code repository as recipe08.js under chapter01. If we run the provided example script, we must change to the root directory of the book's sample code.

The script in this recipe runs against the demo site that is included with the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required