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.
I use the screen screenshot function, the following is the process of my operation and the installation of the screen function test.
First step: Phantomjs installation
Debian and Ubunto installation commands
sudo apt-get install build-essential g++ Flex Bison gperf Ruby perl \
Libsqlite3-dev libfontconfig1-dev libicu-dev libfreetype6 libssl-dev \
libpng -dev libjpeg-dev python libx11-dev libxext-dev
CentOS Install command
sudo yum-y install gcc gcc-c++ make Flex bison Gperf ruby \
openssl-devel freetype-devel fontconfig-devel libicu-devel sqlite-devel \
Libpng-devel Libjpeg-devel
Second Step: Phantomjs compilation
git clone git://github.com/ariya/phantomjs.git
CD PHANTOMJS
git Checkout 2.0
./BUILD.SH (compilation is slow and requires patience)
Part III: Establishing a/usr/local/bin/soft connection ( This executes the command without the path of the command)
ln-s/root/phantomjs/bin/phantomjs/usr/local/bin/phantomjs
Fourth: Test the screenshot function (called JS file directory can set a path constant in the project)
phantomjs /root/phantomjs/examples/rasterize.js/http Www.aitifen.com/upload/report/119.html/data/wwwroot/login2.png
Well, login2.png is the picture I want to get from the screenshot.
Installation procedure and Usage method of PHANTOMJS Linux system