phantomjs(1) headless WebKit scriptable with a JavaScript API


PhantomJS is a headless WebKit scriptable with a JavaScript API. It has fast and native support for various web standards: DOM handling, CSS selector, JSON, Canvas, and SVG.


phantomjs [switchs] [options] [script] [argument [argument [...]]]


Sets the file name to store the persistent cookies
Specifies JSON-formatted configuration file
Prints additional warning and debug message: 'true' or 'false' (default)
Enables disk cache: 'true' or 'false' (default)
Specifies the location for the disk cache
Ignores SSL errors (expired/self-signed certificate errors): 'true' or 'false' (default)
Loads all inlined images: 'true' (default) or 'false'
Allows use of 'file:///' URLs: 'true' (default) or 'false'
Specifies the location for local storage
Sets the maximum size of the local storage (in KB)
Specifies the location for offline storage
Sets the maximum size of the offline storage (in KB)
Allows local content to access remote URL: 'true' or 'false' (default)
Limits the size of the disk cache (in KB)
Sets the encoding for the terminal output, default is 'utf8'
Starts the script in a debug harness and listens on the specified port
Runs the script in the debugger immediately: 'true' or 'false' (default)
Sets the proxy server, e.g. '--proxy='
Provides authentication information for the proxy, e.g. ''-proxy-auth=username:password'
Specifies the proxy type, 'http' (default), 'none' (disable completely), or 'socks5'
Sets the encoding used for the starting script, default is 'utf8'
Sets the script language instead of detecting it: 'javascript'
Enables web security, 'true' (default) or 'false'
Selects a specific SSL protocol version to offer. Values (case insensitive): TLSv1.2, TLSv1.1, TLSv1.0, TLSv1 (same as v1.0), SSLv3, or ANY. Default is to offer all that Qt thinks are secure (SSLv3 and up). Not all values may be supported, depending on the system OpenSSL library.
Sets supported TLS/SSL ciphers. Argument is a colon-separated list of OpenSSL cipher names (macros like ALL, kRSA, etc. may not be used). Default matches modern browsers.
Sets the location for custom CA certificates (if none set, uses environment variable SSL_CERT_DIR. If none set too, uses system default)
Sets the location of a client certificate
Sets the location of a clients' private key
Sets the passphrase for the clients' private key
Starts in 'Remote WebDriver mode' (embedded GhostDriver): '[[<IP>:]<PORT>]' (default '')
File where to write the WebDriver's Log (default 'none') (NOTE: needs '--webdriver')
WebDriver Logging Level: (supported: 'ERROR', 'WARN', 'INFO', 'DEBUG') (default 'INFO') (NOTE: needs '--webdriver')
URL to the Selenium Grid HUB: 'URL_TO_HUB' (default 'none') (NOTE: needs '--webdriver')
Equivalent to '--webdriver' option above
Shows this message and quits
Prints out PhantomJS version

Any of the options that accept boolean values ('true'/'false') can also accept 'yes'/'no'.

Without any argument, PhantomJS will launch in interactive mode (REPL).

Documentation can be found at the web site,