Introduction
In addition to the core APIs discussed in the previous chapter, PhantomJS provides one other critically important module as part of its standard library: the webpage
module.
The webpage
module exposes methods for creating instances of webpage
objects (which are functionally equivalent to browser windows); these instances then have a suite of methods and properties that we can use to inspect and interact with the web pages.
The recipes in this chapter take a deep dive into the webpage
module and include strategies for dealing with web page content. In particular, the recipes introduce us to techniques for interacting with web pages and how to capture those interactions for successful tests.