赞
踩
—-下载程序文件
wget https://phantomjs.googlecode.com/files/phantomjs-1.9.2-linux-x86_64.tar.bz2
,32位ubuntu下载链接应该是https://phantomjs.googlecode.com/files/phantomjs-1.9.2-linux-i686.tar.bz2。
—-解压文件
tar -xvf phantomjs-1.9.2-linux-x86_64.tar.bz2
–将程序移到一个合适的位置
sudo mv phantomjs-1.9.2-linux-x86_64 /usr/local/src/phantomjs
—-创建软链接到环境变量中。这样可以直接在shell中使用phantomjs命令
sudo ln -sf /usr/local/src/phantomjs/bin/phantomjs /usr/local/bin/phantomjs
—-检查是否正常工作
phantomjs --version
如果你看到当前版本号,即表示正常工作了。
—-进入一个你想放弃casper程序的目录
cd /usr/local/src/
—-用git下载最新程序
sudo git clone git://github.com/n1k0/casperjs.git
如果你未安装git,使用
sudo apt-get install git
安装git。
—-创建程序软链接
sudo ln -sf /usr/local/src/casperjs/bin/casperjs /usr/local/bin/casperjs
—-检查是否正常工作
casperjs --version
看到版本号代码你已经成功安装了Casperjs。以上是安装最版本的Casperjs,1.1与1.0存在不兼容。如果你想下载以前的版本,你可以到https://github.com/n1k0/casperjs上下载指定分支版本,然后像第1步安装phantomjs一样安装。Good Luck~ ! :)
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。