centos下安裝chrome和chromedriver
系統centos7.5
1、配置(確認)yum源,默認有CentOS-Base.repo,確認啓用即可
[base]
name=CentOS-releasever&arch=KaTeX parse error: Expected 'EOF', got '&' at position 9: basearch&̲repo=os&infra=infra
#baseurl=http://mirror.centos.org/centos/basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
2、在目錄 /etc/yum.repos.d/ 下新建文件 google-chrome.repo, 並且在該文件中添加如下內容:
[google-chrome]
name=google-chrome
baseurl=http://dl.google.com/linux/chrome/rpm/stable/$basearch
enabled=1
gpgcheck=0
gpgkey=https://dl-ssl.google.com/linux/linux_signing_key.pub
3、安裝依賴
yum install libappindicator-gtk3 liberation-fonts -y
4、安裝chrome
yum -y install google-chrome-stable
5、下載chromedriver 到指定目錄/usr/bin/(可以根據chrome版本確認chromedriver的版本)
wget http://chromedriver.storage.googleapis.com/80.0.3987.16/chromedriver_linux64.zip
6、解壓zip文件,然後給chromedriver 執行文件賦權
unzip chromedriver_linux64.zip
chmod 777 chromedriver
7、驗證
/usr/bin/google-chrome -version
Google Chrome 80.0.3987.162
/usr/bin/chromedriver