forked from ariya/phantomjs
-
Notifications
You must be signed in to change notification settings - Fork 1
Quick Start
ariya edited this page Sep 21, 2012
·
19 revisions
This instruction assumes that PhantomJS is installed and its executable is place somewhere in the PATH.
All of the examples given here are available in the code repository under the sub-directory examples/. For each example, there are two version for each JavaScript and CoffeeScript.
Create a new text file that contains the following two lines:
console.log('Hello, world!');
phantom.exit();Save it as hello.js and the run it:
phantomjs hello.js
The output is:
Hello, world!
In the first line, console.log will print the passed string to the terminal. In the second line, phantom.exit terminates the execution.
It is very important to call phantom.exit at some point in the script, otherwise PhantomJS will not be terminated at all.
(To be written)
(To be written)
(To be written)
(To be written)
(To be written)