centos7下安装 Chrome和ChromeDriver

先安装 Chrome,使用的是.rpm安装包,地址如下

https://pkgs.org/download/google-chrome-stable

具体下载地址为:

http://dl.google.com/linux/chrome/rpm/stable/x86_64//google-chrome-stable-66.0.3359.181-1.x86_64.rpm

在centos命令行输入:

[root@VM_0_8_centos local]# wget http://dl.google.com/linux/chrome/rpm/stable/x86_64//google-chrome-stable-66.0.3359.181-1.x86_64.rpm

接着输入安装命令:

sudo yum localinstall google-chrome-stable-66.0.3359.181-1.x86_64.rpm 

之后安装chromedriver,下载地址:

https://chromedriver.storage.googleapis.com/index.html

需选择与chrome对应的版本安装,之前下载的是chrome66版本,对应的是chromedriver2.35

在centos命令行输入:

wget https://chromedriver.storage.googleapis.com/2.35/chromedriver_linux64.zip

然后解压:

unzip chromedriver_linux64.zip

将其移至/usr/bin/:

mv chromedriver /usr/bin/

或者需要配置chromedriver的环境变量,其位置在/usr/local/

export PATH="$PATH:/usr/local/chromedriver"
source ~/.profile

最后验证安装情况

[root@VM_0_8_centos bin]# chromedriver
Starting ChromeDriver 2.35.528139 (47ead77cb35ad2a9a83248b292151462a66cd881) on port 9515
Only local connections are allowed.



你可能感兴趣的:(centos7下安装 Chrome和ChromeDriver)