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

Chapter 3. Working with webpage Objects

In this chapter, we will cover:

  • Creating a web page instance in PhantomJS with the webpage module

  • Opening a URL within PhantomJS

  • Generating a POST request from PhantomJS

  • Inspecting page content from a PhantomJS script

  • Including external JavaScript on the page

  • Recording debugger messages

  • Simulating mouse clicks in PhantomJS

  • Simulating keyboard input in PhantomJS

  • Simulating scrolling in PhantomJS

  • Simulating mouse hovers in PhantomJS

  • Blocking CSS from downloading

  • Causing images to fail randomly

  • Submitting Ajax requests from PhantomJS

  • Working with WebSockets in PhantomJS