只需五步,在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的安装了

相关推荐
NamoAmitabha1287 小时前
libpng12-0 1.2.54-1ubuntu1.1 (amd64 binary) in ubuntu xenial
linux·ubuntu20.4
Madison-No78 小时前
搭建项目测试环境
linux·运维·服务器·python
吴声子夜歌9 小时前
Shell编程实例——编写安全的shell脚本(二)
linux·运维·shell
tokenKe9 小时前
Tencent BrowserSkill :让 AI Agent 借用你的真实浏览器| 已登录浏览器与编码 Agent 之间的本地桥 |SSP
chrome·开源·github
xiaoye-duck10 小时前
《Linux 网络编程》深入理解 IP 协议(二):网段划分、私有 IP 与 NAT 地址转换
linux·网络·ip
zx_7414848111 小时前
【Linux入门】Shell 函数、正则表达式与文本处理:cut 与 awk
linux·运维·正则表达式
Zenova EdgeOS11 小时前
Linux dmesg 工业边缘实战:内核日志过滤、持久化与故障定位
linux·运维·边缘计算·工业边缘·dmesg·内核日志
金士顿11 小时前
System.Text.Json Source Generator 深度解析:为什么 Native AOT 不喜欢反射
linux·asp.net core·arm64·net·native aot
做运维的阿瑞12 小时前
Python 标准库汇总:分类速览与常用模块清单
linux·运维·python
百万蹄蹄向前冲13 小时前
密码都对Node.js却连不上Linux数据库
linux·mysql