What this book covers
Chapter 1, Getting Started, starts by introducing what PhantomJS is, how to get and install it, and then goes directly into creating your very first script.
Chapter 2, Manipulating Page Content, shows you how to directly interact with pages that we open in our headless browser.
Chapter 3, Handling Events and Callbacks, explores how to capture events that web pages generate for the browser and reacts accordingly. We will also simulate browser events that involve simulating the users' mouse and keyboard events.
Chapter 4, Capturing Errors, focuses on how to handle errors within PhantomJS and those that are generated by the pages.
Chapter 5, Grabbing Pages, plays with one cool feature of PhantomJS, that is, capturing screenshots programmatically.
Chapter 6, Accessing Location-based Services, focuses on using existing web-based and location-based services. Using PhantomJS as our headless browser, we will be capturing location data and creating examples that are useful.
Chapter 7, Working with Files, shows you how to work with files and understand how these are supported by PhantomJS using its own FileSystem API.
Chapter 8, Cookies, discusses how cookies are supported by PhantomJS. We will learn to create cookies and interact with the pages that need them.
Chapter 9, External JavaScript, addresses the subject of working with external JavaScripts and shows how we can create PhantomJS modules that can be re-used in every script.
Chapter 10, Testing with PhantomJS, focuses on the use of PhantomJS for testing. We will learn how to use Jasmine, create test scripts, and make them work using PhantomJS.
Chapter 11, Maximizing PhantomJS, goes over the different products that are written using PhantomJS and shows how we can go beyond what we've learned from the books to make our own applications.