forked from ariya/phantomjs
-
Notifications
You must be signed in to change notification settings - Fork 1
Examples
ariya edited this page Sep 23, 2012
·
6 revisions
PhantomJS comes with a lot of included examples. Often an example comes in two flavors: JavaScript and CoffeScript.
Basic examples
-
hello.jsdisplays the famous message -
version.jsprints out PhantomJS version number -
arguments.jsshows the arguments passed to the script -
fibo.jslists the first few numbers in the Fibonacci sequence -
module.jsanduniverse.jsdemonstrates the use of module system
Rendering/rasterization
-
rasterize.jsrasterizes a web page to image or PDF -
colorwheel.jscreates a color wheel using HTML5 canvas -
technews.jscaptures Google News as a PNG image
Page automation
-
direction.jsuses Google Maps to print driving direction -
ipgeocode.jsdeduces the location via IP geocoding -
follow.jsshows the number of follower of some Twitter accounts -
tweets.jsdisplays the most recent tweets
Network
-
loadspeed.jscomputes the loading speed of a web site -
netlog.jsdumps all network requests and responses -
netsniff.jscaptures network traffic in HAR format
(More to be written)