PHANTOMJS is a WebKit-based server-side JavaScript API. It fully supports the web without the need for browser support, its fast, native support for various web standards: DOM processing, CSS selectors, JSON, Canvas, and SVG. PHANTOMJS can be used for page automation, network monitoring, web screen screenshots, and no interface testing.
#下载PhantomJS安装包wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86 _64.tar.bz2-xjvf phantomjs-2.1. 1-linux-x86_64.tar.bz2# The executable file into the system path will be PHANTOMJS-2.1. 1-linux-x86_64/bin/phantomjs file is placed under/usr/bin/and change file permissions
#安装依赖
Yum Install Fontconfig
Yum Install FreeType
(1) Hello, world!.
(2) Script parameters –script Arguments
(3) Page load –page Loading
Load a special URL (don't forget the HTTP protocol) and measure the time it takes to load the page
(4) Code operation
(5) DOM Operations
Read the attributes of an element with ID myagent textContent
Using jquery and other class libraries
(6) Network request and response
Reference blog:
How to install and configure PHANTOMJS working environment in Linux/centos EnvironmentPHANTOMJS Installation and Quick Start Tutorials
How to install and configure PHANTOMJS working environment in Linux/centos environment