1、安裝chrome
用下面的命令安裝最新的 Google Chrome
yum install https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm
也可以下載到本地再安裝
wget https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm
yum install ./google-chrome-stable_current_x86_64.rpm
安裝必要的庫
yum install mesa-libOSMesa-devel gnu-free-sans-fonts wqy-zenhei-fonts
2、安裝 chromedriver
chrome官網 wget https://chromedriver.storage.googleapis.com/2.38/chromedriver_linux64.zip
淘寶源(推薦)
wget
http://npm.taobao.org/mirrors/chromedriver/2.41/
chromedriver_linux64.zip
將下載的文件解壓,放在如下位置
unzip chromedriver_linux64.zip
/usr/bin/chromedriver
給予執行權限
chmod +x /usr/bin/chromedriver
還可以參考這篇文章,雖然沒試過,但感覺很牛逼
https://intoli.com/blog/installing-google-chrome-on-centos/