Introduction

PhantomJS is a scripted, headless browser that can be used for automating web page interaction. PhantomJS is a free, open source and distributed under the BSD license. PhantomJS is based on WebKit and is very similar browsing environment to Safari and Google Chrome. The PhantomJS JavaScript API can be used to open web pages, execute user actions and take screenshots.

In this tutorial, we will learn how to install PhantomJS in Ubuntu 16.04 server.

Step 1: Update the system

Before starting, it is recommended to update the system with the latest stable release. You can do this with the following command:

sudo apt-get update -y
sudo apt-get upgrade -y
sudo shutdown -r now

Step 2: Install PhantomJS

Before installing PhantomJS, you will need to install some required packages on your system. You can install all of them with the following command:
sudo apt-get install build-essential chrpath libssl-dev libxft-dev libfreetype6-dev libfreetype6 libfontconfig1-dev libfontconfig1 -y

Next, you will need to download the PhantomJS. You can download the latest stable version of the PhantomJS from their official website. Run the following command to download PhantomJS:
sudo wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2

Once the download is complete, extract the downloaded archive file to desired system location:
sudo tar xvjf phantomjs-2.1.1-linux-x86_64.tar.bz2 -C /usr/local/share/

Next, create a symlink of PhantomJS binary file to systems bin dirctory:
sudo ln -s /usr/local/share/phantomjs-2.1.1-linux-x86_64/bin/phantomjs /usr/local/bin/

Step 3: Verify PhantomJS

PhantomJS is now installed on your system. You can now verify the installed version of PhantomJS with the following command:
phantomjs --version

You should see the following output:

2.1.1

How to Install PhantomJS on Ubuntu 16.04的更多相关文章

  1. How To Install Nginx on Ubuntu 16.04 zz

    Introduction Nginx is one of the most popular web servers in the world and is responsible for hostin ...

  2. ubuntu 16.04上源码编译和安装cgal并编写CMakeLists.txt | compile and install cgal on ubuntu 16.04

    本文首发于个人博客https://kezunlin.me/post/39ab7ed9/,欢迎阅读最新内容! compile and install cgal on ubuntu 16.04 Guide ...

  3. ubuntu 16.04 上编译和安装C++机器学习工具包mlpack并编写mlpack-config.cmake | tutorial to compile and install mplack on ubuntu 16.04

    本文首发于个人博客https://kezunlin.me/post/1cd6a04d/,欢迎阅读最新内容! tutorial to compile and install mplack on ubun ...

  4. How To Install MySQL on Ubuntu 16.04

    https://help.ubuntu.com/lts/serverguide/mysql.html http://www.cnblogs.com/wuhou/archive/2008/09/28/1 ...

  5. How to Install KDE on Ubuntu 16.04

    sudo add-apt-repository ppa:kubuntu-ppa/backportssudo apt-get updatesudo apt-get dist-upgradesudo ap ...

  6. MySQL5.7的安装(CentOS 7 & Ubuntu 16.04)

    CentOS 通过 yum 安装MySQL5.7 Yum Repository 下载地址:https://dev.mysql.com/downloads/repo/yum/ 选择相应的版本进行下载:R ...

  7. [GUIDE] How to Setup Ubuntu 16.04 LTS Xenial Xerus for Compiling Android ROMs

    With a new version of Ubuntu comes an update to my guide for setting up a build environment to compi ...

  8. Ubuntu 16.04 一系列软件安装命令,包括QQ、搜狗、Chrome、vlc、网易云音乐安装方法

    1 简介 Ubuntu 16.04安装完后,还需要做一些配置才能愉快的使用,包括添加软件源.安装搜狗输入法.Chrome浏览器.网易云音乐.配置快捷键.安装git等等,下面就跟着我来配置吧,just ...

  9. Install and Configure Apache Kafka on Ubuntu 16.04

    https://devops.profitbricks.com/tutorials/install-and-configure-apache-kafka-on-ubuntu-1604-1/ by hi ...

随机推荐

  1. 黑马旅游网配置 pom.xml

    <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://mave ...

  2. 使用JS判断客户端、浏览器、操作系统类型

    一.JS判断客户端类型 JS判断客户端是否是iOS或者Android手机移动端 通过判断浏览器的userAgent,用正则来判断手机是否是ios和Android客户端. 核心代码如下: 方法一: &l ...

  3. hdu5709Claris Loves Painting主席树 奇妙的DFS序

    先不考虑层数限制 一棵树上每个点有个颜色,问一棵子树的颜色数 感觉简单多了是吧 考虑每个点的贡献:自己到根的路径上的一个包含自己的连续段 观察最顶端的点的父亲: 它满足有了额外的同色孩子(咦) 这一条 ...

  4. python之is 和 == 的区别//编码和解码

    一.is  和  ==  的区别: 1  .id()   内存地址 2.  ==   比较    #比较两边的值 3.   is    比较   #比较的是内存地址 数字,字符串,有小数据池 #数字小 ...

  5. 039 Combination Sum 组合总和

    给一组候选数字(C)(没有重复)并给一个目标数字(T),找出 C 中所有唯一的组合使得它们的和为 T.可以从 C 无限次数中选择相同的数字.说明:    所有数字(包括目标)都是正整数.    解集合 ...

  6. MiniDao分页的坑

    //TODO 此处切记不要传(page-1)*rows,MiniDAO底层已经做了此运算,.sql文件中也无需写limit,会自动加上List<BcProjectSampleBackEntity ...

  7. ABAP事件的简单用法

    1.1.事件: 用于捕获某类对象状态的改变来触发事件的方法,并进行处理 1.2.定义:可以在类或接口中进行声明 EVENTS|CLASS-EVENTS evt  EXPORTING … VALUE(p ...

  8. ios获取数据之encodeURI 和 decodeURI

    在APP开发过程中,免不了要进行ios的数据处理,在ios传递数据的过程中,会出现JSON数据获取不到的情况,这时候就轮到encodeURI 和 decodeURI出马了. 1.encodeURI,d ...

  9. Memcache笔记02-telnet操作memcached

    telnet操作Memcached 登录到telnet连接到memcached服务: telnet 127.0.0.1 11211 memcached的基本命令: //当telnet登录成功可以看到一 ...

  10. Python3+Selenium3+webdriver学习笔记12(js操作应用:滚动条 日历 内嵌div)

    #!/usr/bin/env python# -*- coding:utf-8 -*-'''Selenium3+webdriver学习笔记12(js操作应用:滚动条 日历 内嵌div)'''from ...