phantomjs + selenium headless test

1. 安装selenium

pip install selenium

2. 安装phantomjs

如果你是Ubuntu12.04,默认安装的版本是1.4.这个会出错。

需要安装1.9.7

cd /usr/local/share
sudo wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.7-linux-x86_64.tar.bz2
sudo tar xjf phantomjs-1.9.7-linux-x86_64.tar.bz2
sudo ln -s /usr/local/share/phantomjs-1.9.7-linux-x86_64/bin/phantomjs /usr/local/share/phantomjs
sudo ln -s /usr/local/share/phantomjs-1.9.7-linux-x86_64/bin/phantomjs /usr/local/bin/phantomjs
sudo ln -s /usr/local/share/phantomjs-1.9.7-linux-x86_64/bin/phantomjs /usr/bin/phantomjs

 

posted @ 2014-06-11 08:55  马僧  阅读(466)  评论(0编辑  收藏  举报