Conventions

In this book, you will find a number of styles of text that distinguish between different kinds of information. The following are some examples of these styles, and an explanation of their meaning.

Code words in text are shown as follows: "The onLoadStarted event will be triggered when PhantomJS starts loading the page based on the resources received."

A block of code is set as follows:

var system = require('system');
var url = system.args[1];

var page = require('webpage').create();
page.onLoadStarted = function () {
  console.log('Page Loading Started');
};

page.onLoadFinished = function () {
  console.log('Page Loaded');
  phantom.exit(0);
};

page.open(url);

When we wish to draw your attention to a particular part of a code block, the relevant ...

Get Getting Started with PhantomJS now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.