https://dl-sh-ctc-2.pchome.net/45/jq/google-chrome-stable_current_x86_64.rpm

1、安装chrome

用下面的命令安装最新的 Google Chrome(这样安装的Google浏览器是最新版本的,可能与chromedriver不匹配)

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

如果安装后发现与chromedriver版本不匹配,可以将其卸载掉,下载合适版本,到本地安装

# 查看已安装的Google浏览器版本
rpm -qa|grep google-chrome 
# 卸载高版本google-chrome
rpm -e google-chrome(全名)
# 安装已经下载的google-chrome***.rpm
rpm -ivh google-chrome***.rpm