今天需要在Linux上放一个selenium的小程序,所以安装一下Chrome以及ChromeDriver

一、Linux安装Chrome

我这里环境是Centos7.x,采取了最快的安装最新 Chrome 版本的最简单方法

1
curl https://intoli.com/install-google-chrome.sh | bash

有其他版本需求可以参考:https://intoli.com/blog/installing-google-chrome-on-centos/

安装完成,验证一下是否成功,以及Chrome的版本,后续会用到

google-chrome --version

二、Linux安装ChromeDriver

chrome官方:http://chromedriver.storage.googleapis.com/index.html

淘宝源:https://npm.taobao.org/mirrors/chromedriver

我们下载对应版本,从上面我们可知版本为91.0.4472.114

那我们从中找到进行下载

wget http://chromedriver.storage.googleapis.com/91.0.4472.101/chromedriver_linux64.zip

进行解压

unzip chromedriver_linux64.zip /usr/bin

验证一下,成功安装

\