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

Introduction


Up to this point, our discussion on PhantomJS focused on its headless nature; while there are many advantages to it, there is also one obvious disadvantage—you can't see anything when you need to.

Fortunately, the PhantomJS webpage API exposes a couple of methods for rendering web page content as images and documents. We have seen a couple of these methods already; in this chapter, we will explore them in more detail, and discuss how to apply them. We will see strategies for exporting different types of images, PDFs, rasterizing SVGs, and everything else we need to know to get visual information back out of PhantomJS.