How to Install PhantomJS on Ubuntu 16.04

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

原文地址:https://www.cnblogs.com/carious/p/9942479.html

时间: 2024-08-03 15:01:29

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

Install Mariadb in Ubuntu 16.04 LTS

MariaDB官网提供了repository https://downloads.mariadb.org/mariadb/repositories/#mirror=tuna 在这里可以查询到各类系统的安装方法,这里仅对Ubuntu 16.04 LTS讲解. add key sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8 add sources sudo sh -c

Install Atom in Ubuntu 16.04 LTS

Atom是一款现代化,平易近人的文本编辑器,它可以嵌入到内核中 - 这个工具可以自定义做任何事情,但也可以有效地使用,而无需触摸配置文件.这里讲解它在Ubuntu 16.04 Desktop LTS环境中基于ppa模式的的安装过程. add ppa apt add-repository ppa:webupd8team/atom update apt update install sudo apt-get install atom 原文地址:http://blog.51cto.com/qwfys2

Install Docker in Ubuntu 16.04 LTS

add key sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D add sources sudo apt-add-repository 'deb https://apt.dockerproject.org/repo ubuntu-xenial main' update apt update install a

Install Chrome in Ubuntu 16.04 LTS

add key wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add - add sources sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' upda

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/1301071.html 注:建议将/etc/apt/source.list中的cn改成us,美国的服务器比中国的快很多. https://www.digitalocean.com/community/tutorials/how-to-install-mysql-on-ubuntu-16-04 原文地

[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 compile Android ROMs. The aim of this is to simplify the configuration process and teach a little bit about the command line. Follow the directions step-by

Lex Example on Ubuntu 16.04

Install Lex on Ubuntu 16.04. Lex is in flex and Yacc in bison. sudo apt install flex bison Create an empty file and edit it. digit [0-9] letter [A-Za-z] %{ int count; %} %% /* match identifier */ {letter}({letter}|{digit})* {count++; printf("number o

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

1 简介 Ubuntu 16.04安装完后,还需要做一些配置才能愉快的使用,包括添加软件源.安装搜狗输入法.Chrome浏览器.网易云音乐.配置快捷键.安装git等等,下面就跟着我来配置吧,just do it 2 版本选择 如果你是小白,不想折腾,可以直接选择安装deepin linux,中文名”深度Linux”,这个是国内目前最好用的Linux之一,开箱即用,常用软件都安装好了,甚至连最新版的QQ都有,mac风格的界面也很漂亮. 但是,作为一个程序员,还是要使用Ubutnu,之前博主用过Ub

mariadb install on Ubuntu 16.04.1 LTS

最近在尝试基于Ubuntu 16.04.1 LTS server 部署openstack ,在部署的过程中遇到mariadb 无法正常链接. 问题 参照openstack 官方文档安装mariadb,安装后遇到无法在本地登录的问题 $mysql -u root -p $mysql -h localhost -u root -p 报错如下 mysql (mariadb) ERROR 1698 (28000): Access denied for user 'root'@'localhost' 但使