centos安裝PhantomJS+selenium+pip

安裝piphtml

1.安裝pip依賴python

yum -y install epel-release

2.安裝piplinux

yum -y install python-pip

到此pip安裝成功bash

安裝seleniumcode

pip install selenium

安裝PhantomJShtm

1.下載PhantomJS (http://phantomjs.org/download.html)根據系統找到對應包 個人linux64ip

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

2.解壓get

# 下載好後進行解壓(因爲是bz2格式,要先進行bzip2解壓成tar格式,再使用tar解壓)
bzip2 -d phantomjs-2.1.1-linux-x86_64.tar.bz2

# 再使用tar進行解壓到/usr/local/目錄下邊
tar xvf phantomjs-2.1.1-linux-x86_64.tar -C /usr/local/

# 安裝依賴軟件
yum -y install wget fontconfig

# 重命名(方便之後使用phantomjs命令)
 mv /usr/local/phantomjs-2.1.1-linux-x86_64/ /usr/local/phantomjs

# 最後一步就是創建軟鏈接了(在/usr/bin/目錄下生產一個phantomjs的軟鏈接,/usr/bin/是啥目錄應該清楚,不清楚使用 echo $PATH查看)
ln -s /usr/local/phantomjs/bin/phantomjs /usr/bin/
相關文章
相關標籤/搜索