安装步骤

# 安装依赖软件 yum -y install wget fontconfig

# 下载PhantomJS wget -P /tmp/ https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-i686.tar.bz2  # 解压 tar xjf /tmp/phantomjs-2.1.1-linux-i686.tar.bz2 -C /usr/local/ # 重命名 mv /usr/local/phantomjs-2.1.1-linux-i686 /usr/local/phantomjs

# 建立软链接 ln -s /usr/local/phantomjs/bin/phantomjs /usr/bin/

测试

在终端执行phantomjs命令,如果跟我下图的结果一样就表示安装成功了。

如果你还不放心的话,可以创建一个JS文件测试一下。文件内容如下:

console.log('Hello, world!');
phantom.exit();

保存为test.js,然后通过phantomjs test.js执行。下图是我执行的结果:

安装PhantomJS的更多相关文章

  1. [Python爬虫] 在Windows下安装PhantomJS和CasperJS及入门介绍(上)

    最近在使用Python爬取网页内容时,总是遇到JS临时加载.动态获取网页信息的困难.例如爬取CSDN下载资源评论.搜狐图片中的“原图”等,此时尝试学习Phantomjs和CasperJS来解决这个问题 ...

  2. Linux(CentOs)下安装Phantomjs + Casperjs

    Linux(CentOs)下安装Phantomjs + Casperjs 是参照cnMiss's Blog http://ju.outofmemory.cn/entry/70691的博客进行安装的 1 ...

  3. windows环境安装phantomjs和pyspider遇到的问题

    1. 安装phantomjs 下载地址:http://phantomjs.org/download.html 解压后将phantomjs.exe文件放到python根目录 2.安装pyspider p ...

  4. centos 7安装phantomjs

    centos 7安装phantomjs wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_6 ...

  5. linux(ubuntu)下安装phantomjs

    1.安装phantomjs ubuntu下sudo apt-get install phantomjs下载的不能用 —-下载程序文件 到官网下载 1.安装phantomjs —-下载程序文件 wget ...

  6. 安装phantomjs(Ubuntu版本 MacOS版本)

    安装phantomjs(Ubuntu版本) 首先:apt-get update # 更新软件列表. apt-get upgrade # 更新软件. 其次再执行如下步骤 步骤一下载包:wget http ...

  7. Linux下安装Phantomjs

    1. 安装linux系统的软件包 先来看一下官方网站的提示: Note: For this static build, the binary is self-contained. There is n ...

  8. Ubuntu下安装 Phantomjs

    1.安装phantomjs —-下载程序文件 wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.7-linux-x8 ...

  9. centos 安装phantomjs

    sudo yum install gcc gcc-c++ make git openssl-devel freetype-devel fontconfig-devel git clone git:// ...

随机推荐

  1. JavaScript系列:正则表达式

    function testExecResultType() { var txt = "mom and dad and baby"; var pattern = /mom (and ...

  2. MFC添加背景图片

    1.在资源里导入一个bmp图片假设名称为IDB_BITMAP1 实现OnPaint方法 CPaintDC dc(this); CRect rect; GetClientRect(&rect); ...

  3. Laravel 安装多国语言包后,phpstorm 还是报错

    问题: 解决办法: vagrant@homestead:~/Code/awbeci$ composer require "overtrue/laravel-lang:~3.0" 总 ...

  4. 东大OJ-双塔问题

    1212: VIJOS-P1037 时间限制: 0 Sec  内存限制: 128 MB 提交: 58  解决: 19 [提交][状态][讨论版] 题目描述         2001年9月11日,一场突 ...

  5. android 随记 ContentValues

    ContentValues 和HashTable类似都是一种存储的机制 但是两者最大的区别就在于,contenvalues只能存储基本类型的数据,像string,int之类的,不能存储对象这种东西,而 ...

  6. HashTable、HashMap、HashSet

    1. HashMap 1)  hashmap的数据结构 Hashmap是一个数组和链表的结合体(在数据结构称“链表散列“),如下图示: 当我们往hashmap中put元素的时候,先根据key的hash ...

  7. Day Six(Beta)

    站立式会议 站立式会议内容总结 331 今天:完成闹钟功能,远程数据库采用bmob的解决方案,应用初始化bmob 遇到问题:闹钟没有取消提醒 以及多次设置提醒的问题 明天:修改闹钟问题,完成文件下载( ...

  8. less sass学习总结(——待续哦——)

    一:less.sass是为了解决什么?  为什么要让css以编程语言来书写呢?

  9. Java网络编程——UDP实例

    UDPSendDemo import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamRea ...

  10. __getattr__与__getattribute__

    class Foo: def __init__(self,x): self.x=x def __getattr__(self, item): print("执行的是我----->&qu ...