What Is PhantomJS - 2/6

Опубликовано: 01 Июнь 2026
на канале: JsWiz
11,418
61

Full Course: https://goo.gl/QEo1ie

Learn what PhantomJS is and how it can be used as a Headless Browser.

This course will be focused on CasperJS - and we'll be using the Casper API to write all of our scripts. However, since Casper is built on top of PhantomJS its important to have an understanding of what PhantomJS is.

PhantomJS is described on their website as a Full Web Stack with no browser reqiured.

And it is also described as a Headless Browser. This means that anything you can do in a standard browser like Chrome/Safari or firefox, you can also do with PhantomJS.

What can you do with PhantomJS?

PhantomJS allows us to perform many interesting actions on a web page like perform page manipulation, simulate user interaction and dynamically capture and save website data as well as capturing parts of a webpage and then rendering that area as an image.

The most common use case for PhantomJS is provide an interface for testing the UI of web applications.

However, we can also use Phantom and Casper as a means for scraping any kind of website data we want in a dynamic manner.

Some of the ways that we're able to manipulate pages includes: being able to submit forms, click buttons, take actions on input fields, perform logins, wait for AJAX to load and queue multiple URL's to perform actions on these pages.

PhantomJS acts as a stand-alone program that you can download. And can be used to run JavaScript files in your terminal. The scripts that you write are based on the API available on their website.