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. mysql5.6数据库同步,单向双向同步问题

    windows下MySQL5.6实现主从数据库同步数据   mysql5.6数据库同步,单向双向同步问题 一.单向同步 主数据库(mysql5.6)192.168.1.104 从数据库(mysql5. ...

  2. 页面出现滚动条时,body里面的内容不能自动居中?

    弹窗后允许页面滚动 这种方式通常使用 position: absolute; ,可以看看我做的这个 Demo.主要用来应对弹窗内容很大很多的情况,超过了屏幕的宽高需要产生滚动条来方便浏览者查看.有一些 ...

  3. [Java]hashCode的作用

    一.如何理解hashCode的作用: 以java.lang.Object来理解,JVM每new一个Object,它都会将这个Object丢到一个Hash哈希表中去,这样的话,下次做Object的比较或 ...

  4. Memcache未授权访问漏洞利用及修复

    Memcached是一套分布式的高速缓存系统.它以Key-Value(键值对)形式将数据存储在内存中,这些数据通常是应用读取频繁的.正因为内存中数据的读取远远大于硬盘,因此可以用来加速应用的访问.本文 ...

  5. WPF机制和原理

    最近由于项目需要,自己学习了一下WPF,之前接触过sliverlight,所以对理解和编写XAML不是太陌生.其实XAML和html多少还是有点类似的.只不过XAML上添加上了自动binding机制( ...

  6. MyBatis学习总结(三)---映射文件及引入方式

    MyBatis的强大,主要原于它强大映射功能,相对其它的jdbc,使用MyBatis,你会发现省掉很多代码.上一篇已经简单做出一个实例.今天就了解一下MyBatis的映射xml文件. 了解上一篇fri ...

  7. c# 字符串的首字母大写转换 方法

    方法1: s.Substring(0,1).ToUpper()+s.Substring(1);  方法2: s = System.Threading.Thread.CurrentThread.Curr ...

  8. Java_面向对象的 static 和 abstract

    static:表示静态的 static:可以用来修饰属性.方法.代码块(或初始化块).内部类. 一.static修饰属性(类变量): public class TestStatic { //stati ...

  9. Redis set(集合)

    Redis 的 Set 是 String 类型的无序集合,元素不允许重复. Redis 中集合是通过哈希表实现的,所以添加,删除,查找的复杂度都是 O(1). 集合中最大的元素数为 232 - 1 ( ...

  10. Spring事务的5种隔离级别

    概述:isolation设定事务的隔离级别,事务管理器根据它来控制另外一个事务可以看到本事务内的哪些数据. 定义的5个不同的事务隔离级别: DEFAULT:默认的隔离级别,使用数据库默认的事务隔离级别 ...