1、首先要安装Chrome
用下面的命令安装最新的Google Chrome
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
2、安装必要的库(可先不安装)
yum install mesa-libOSMesa-devel gnu-free-sans-fonts wqy-zenhei-fonts
3、安装 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
4、解压zip文件:
unzip chromedriver_linux64.zip
5、移动chromedriver
mv chromedriver /usr/bin/
6、最后验证安装情况
[root@c-gksk-node03-dev robotframework]# chromedriver
Starting ChromeDriver 103.0.5060.134 (8ec6fce403b3feb0869b0732eda8bd95011d333c-refs/branch-heads/5060@{#1262}) on port 9515
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
ChromeDriver was started successfully.
转载来源:https://www.jianshu.com/p/3999fc8b7dd1/