Book Image

PhantomJS Cookbook

By : Rob Friesel
Book Image

PhantomJS Cookbook

By: Rob Friesel

Overview of this book

Table of Contents (15 chapters)
PhantomJS Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Executing a simple performance analysis


In this recipe, we will demonstrate how to execute a simple performance analysis using confess.js.

Getting ready

To run this recipe, we will need a target URL.

We will use confess.js to analyze that target URL and produce a lightweight performance report.

Note

Details about how to obtain confess.js are included in the Listing CSS properties recipe, earlier in this chapter.

Lastly, the script in this recipe runs against the demo site that is included with the book's sample code repository. To run that demo site, we must have Node.js installed. In a separate terminal, change to the phantomjs-sandbox directory (in the sample code's directory), and start the app with the following command:

node app.js

How to do it…

With the Node.js demo app running, make sure we are in the root directory for the book's sample code, and enter the following on the command line:

phantomjs lib/confess/confess.js http://localhost:3000/css-demo performance lib/confess/config.json

Something...