linux(ubuntu)下安装phantomjs

1.安装phantomjs

ubuntu下sudo apt-get install phantomjs下载的不能用

—-下载程序文件

到官网下载

1.安装phantomjs

—-下载程序文件

wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.7-linux-x86_64.tar.bz2

32位ubuntu下载链接是https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.7-linux-i686.tar.bz2。

—-解压文件

tar -xvf phantomjs-1.9.7-linux-x86_64.tar.bz2

–将程序移到一个合适的位置

sudo mv phantomjs-1.9.7-linux-x86_64 /usr/local/src/phantomjs

—-创建软链接到环境变量中。这样可以直接在shell中使用phantomjs命令

sudo ln -sf /usr/local/src/phantomjs/bin/phantomjs /usr/local/bin/phantomjs

—-检查是否正常工作

phantomjs

如果你看到当前版本号,即表示正常工作了。

原文地址:https://www.cnblogs.com/hyh123/p/8146345.html