只需五步,在Linux安装chrome及chromedriver(CentOS)

一、安装Chrome

1)先执行命令下载chrome:

bash 复制代码
wget https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm

2)安装chrome

bash 复制代码
yum localinstall google-chrome-stable_current_x86_64.rpm

看到下图中的Complete出现则代表安装完成:

二、安装Chromedriver

1)查看安装的chrome版本:

bash 复制代码
google-chrome --version

我这里的版本为:Google Chrome 115.0.5790.170 则需要安装对应版本的chromedriver

但有时候没有对应版本的chromedriver则安装次一级的也可以

2)下载chromedriver

访问chromedriver镜像地址 可以看到各版本的chromedriver:


然后找到对应版本的linux版使用下载即可:


我们同样可以使用wget进行下载,右键点击对应包后,点击复制链接地址:

然后再终端粘贴进行下载,命令如下:

bash 复制代码
wget https://registry.npmmirror.com/-/binary/chromedriver/114.0.5735.90/chromedriver_linux64.zip

注意:更多情况你的chrome版本是大于114或更高的,再上面的链接找不到对应的driver版本

那你可以访问 https://googlechromelabs.github.io/chrome-for-testing/#stable 这个地址去下载更新的chromedriver:

3)解压添加至环境变量

将chromdriver解压后移动到bin目录下:

bash 复制代码
unzip chromedriver_linux64.zip  
mv chromedriver /usr/bin

这样我们就完成了chrome和chromedriver的安装了

相关推荐
不能跑的代码不是好代码8 小时前
Linux系统常用命令中文速查表
linux·运维·服务器
石一峰6998 小时前
深入理解 Linux 中断三层机制与 1-Wire 时序锁原理
linux·运维·服务器
无限码农9 小时前
Linux上通过cmake编译uchardet
linux·运维·服务器
运维大师10 小时前
【Linux运维极简教程】06-网络配置与管理
linux·运维
探索云原生13 小时前
终于搞懂 Kueue:5 个核心对象一次讲透
linux·docker·ai·云原生·kubernetes
An_s14 小时前
机器学习python之识别图中物品信息
java·linux·开发语言
Championship.23.2414 小时前
Linux 3.0 LVDS驱动开发详解
linux·运维·驱动开发·lvds
风向决定发型丶15 小时前
Shell中的特殊变量
linux·运维·bash
mounter62516 小时前
走向长时运行:引入协程(Coroutines),打破 BPF 程序的“一堂到底”限制
linux·ebpf·kernel
运维大师16 小时前
【Linux运维极简教程】05-软件包管理
linux·运维·服务器