centos7下安装 Chrome和ChromeDriver

具体下载地址为:

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

你可能感兴趣的:(服务器centos)