最新版本链接:https://googlechromelabs.github.io/chrome-for-testing/
当需要进行自动化测试或爬取网页数据时,Chrome浏览器的驱动程序(ChromeDriver)是一个关键组件。它允许控制和与Chrome浏览器进行交互。在本文中,将为介绍如何下载和安装ChromeDriver。
ChromeDriver是一个用于自动化控制和与Google Chrome浏览器进行交互的驱动程序。它是Chrome浏览器的一个开源项目,由Chrome开发团队开发和维护。
ChromeDriver允许开发人员使用编程语言(如Python、Java、C#等)编写脚本,以控制Chrome浏览器的行为。通过ChromeDriver,您可以模拟用户在浏览器中执行的各种操作,例如打开网页、填写表单、点击按钮、滚动页面等。这使得自动化测试和网页数据爬取变得更加简单和高效。
ChromeDriver与特定版本的Chrome浏览器相对应,因此在使用ChromeDriver之前,您需要确保安装与您当前使用的Chrome浏览器版本相匹配的ChromeDriver版本。这样可以确保ChromeDriver能够与浏览器正确地进行通信和控制。
ChromeDriver在自动化测试、网页爬虫、网页截图、性能测试等领域被广泛使用。它为开发人员提供了一种方便的方式来控制和管理Chrome浏览器,以实现各种自动化任务。
需要注意的是,安装和使用ChromeDriver需要一定的技术知识和编程经验。但一旦掌握了基本的使用方法,您就可以充分利用ChromeDriver的功能,提高开发和测试效率。
setp1:查看Chrome浏览器版本
首先,需要检查Chrome浏览器的版本。请按照以下步骤进行:
这将打开一个新的标签页,显示当前安装的Chrome浏览器的版本号。请记下这个版本号,因为需要确保下载与Chrome浏览器版本相匹配的ChromeDriver。
step2:下载ChromeDriver
知道了Chrome浏览器的版本号,就可以开始下载相应版本的ChromeDriver了。请按照以下步骤进行:
ChromeDriver下载页面:
淘宝镜像:https://registry.npmmirror.com/binary.html?path=chromedriver/
官方镜像:https://sites.google.com/a/chromium.org/chromedriver/downloads
在下载页面上,将看到一列Chrome浏览器的版本号和相应的ChromeDriver版本号。
找到与Chrome浏览器版本号相匹配的ChromeDriver版本,并点击下载链接。
请注意,ChromeDriver的下载文件是一个压缩文件,根据操作系统,选择适当的下载文件。
115以上版本下载看末尾表格
step3:安装ChromeDriver
完成了ChromeDriver的下载,接下来将其解压缩并将其添加到系统的PATH环境变量中。请按照以下步骤进行:
将下载的ChromeDriver压缩文件解压缩到浏览器的安装目录下:C:\Program Files (x86)\Google\Chrome\Application(要根据自己实际安装目录)
在操作系统中,找到系统的环境变量设置。
以下是几个常见操作系统的环境变量设置位置:
- Windows:控制面板 -> 系统和安全 -> 系统 -> 高级系统设置 -> 环境变量。
- macOS:在终端中输入“nano ~/.bash_profile”来编辑bash profile文件。
- Linux:在终端中输入“nano ~/.bashrc”来编辑bashrc文件。
在环境变量设置中,找到名为“PATH”的变量,并在其值中添加ChromeDriver的路径。例如,如果将ChromeDriver解压缩到“C:\chromedriver”(Windows)或“/usr/local/bin/chromedriver”(macOS / Linux),则需要将该路径添加到PATH变量中。
保存并关闭环境变量设置文件后,请确保重启终端或命令提示符窗口,以使环境变量更改生效。
step4:验证安装
安装完成后,可以验证ChromeDriver是否正确安装并可用。请按照以下步骤进行:
这意味着已成功安装ChromeDriver,并且它已添加到系统的PATH环境变量中。
通过遵循以上步骤,可以轻松下载和安装ChromeDriver。请记住,确保下载与Chrome浏览器版本匹配的ChromeDriver,并将其正确添加到系统的PATH环境变量中。
类别 | 平台 | 下载链接 |
---|---|---|
chrome | linux64 | https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/115.0.5790.170/linux64/chrome-linux64.zip |
chrome | mac-arm64 | https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/115.0.5790.170/mac-arm64/chrome-mac-arm64.zip |
chrome | mac-x64 | https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/115.0.5790.170/mac-x64/chrome-mac-x64.zip |
chrome | win32 | https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/115.0.5790.170/win32/chrome-win32.zip |
chrome | win64 | https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/115.0.5790.170/win64/chrome-win64.zip |
chromedriver | linux64 | https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/115.0.5790.170/linux64/chromedriver-linux64.zip |
chromedriver | mac-arm64 | https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/115.0.5790.170/mac-arm64/chromedriver-mac-arm64.zip |
chromedriver | mac-x64 | https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/115.0.5790.170/mac-x64/chromedriver-mac-x64.zip |
chromedriver | win32 | https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/115.0.5790.170/win32/chromedriver-win32.zip |
chromedriver | win64 | https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/115.0.5790.170/win64/chromedriver-win64.zip |
类别 | 平台 | 下载链接 |
---|---|---|
chrome | linux64 | https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/116.0.5845.96/linux64/chrome-linux64.zip |
chrome | mac-arm64 | https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/116.0.5845.96/mac-arm64/chrome-mac-arm64.zip |
chrome | mac-x64 | https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/116.0.5845.96/mac-x64/chrome-mac-x64.zip |
chrome | win32 | https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/116.0.5845.96/win32/chrome-win32.zip |
chrome | win64 | https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/116.0.5845.96/win64/chrome-win64.zip |
chromedriver | linux64 | https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/116.0.5845.96/linux64/chromedriver-linux64.zip |
chromedriver | mac-arm64 | https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/116.0.5845.96/mac-arm64/chromedriver-mac-arm64.zip |
chromedriver | mac-x64 | https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/116.0.5845.96/mac-x64/chromedriver-mac-x64.zip |
chromedriver | win32 | https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/116.0.5845.96/win32/chromedriver-win32.zip |
chromedriver | win64 | https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/116.0.5845.96/win64/chromedriver-win64.zip |
类别 | 平台 | 下载链接 |
---|---|---|
chrome | linux64 | https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/117.0.5938.92/linux64/chrome-linux64.zip |
chrome | mac-arm64 | https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/117.0.5938.92/mac-arm64/chrome-mac-arm64.zip |
chrome | mac-x64 | https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/117.0.5938.92/mac-x64/chrome-mac-x64.zip |
chrome | win32 | https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/117.0.5938.92/win32/chrome-win32.zip |
chrome | win64 | https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/117.0.5938.92/win64/chrome-win64.zip |
chromedriver | linux64 | https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/117.0.5938.92/linux64/chromedriver-linux64.zip |
chromedriver | mac-arm64 | https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/117.0.5938.92/mac-arm64/chromedriver-mac-arm64.zip |
chromedriver | mac-x64 | https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/117.0.5938.92/mac-x64/chromedriver-mac-x64.zip |
chromedriver | win32 | https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/117.0.5938.92/win32/chromedriver-win32.zip |
chromedriver | win64 | https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/117.0.5938.92/win64/chromedriver-win64.zip |
类别 | 平台 | 下载链接 |
---|---|---|
chrome | linux64 | https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/118.0.5993.18/linux64/chrome-linux64.zip |
chrome | mac-arm64 | https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/118.0.5993.18/mac-arm64/chrome-mac-arm64.zip |
chrome | mac-x64 | https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/118.0.5993.18/mac-x64/chrome-mac-x64.zip |
chrome | win32 | https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/118.0.5993.18/win32/chrome-win32.zip |
chrome | win64 | https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/118.0.5993.18/win64/chrome-win64.zip |
chromedriver | linux64 | https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/118.0.5993.18/linux64/chromedriver-linux64.zip |
chromedriver | mac-arm64 | https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/118.0.5993.18/mac-arm64/chromedriver-mac-arm64.zip |
chromedriver | mac-x64 | https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/118.0.5993.18/mac-x64/chromedriver-mac-x64.zip |
chromedriver | win32 | https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/118.0.5993.18/win32/chromedriver-win32.zip |
chromedriver | win64 | https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/118.0.5993.18/win64/chromedriver-win64.zip |
chrome-headless-shell | linux64 | https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/118.0.5993.18/linux64/chrome-headless-shell-linux64.zip |
chrome-headless-shell | mac-arm64 | https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/118.0.5993.18/mac-arm64/chrome-headless-shell-mac-arm64.zip |
chrome-headless-shell | mac-x64 | https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/118.0.5993.18/mac-x64/chrome-headless-shell-mac-x64.zip |
chrome-headless-shell | win32 | https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/118.0.5993.18/win32/chrome-headless-shell-win32.zip |
chrome-headless-shell | win64 | https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/118.0.5993.18/win64/chrome-headless-shell-win64.zip |
类别 | 平台 | 下载链接 |
---|---|---|
chrome | linux64 | https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/119.0.6026.0/linux64/chrome-linux64.zip |
chrome | mac-arm64 | https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/119.0.6026.0/mac-arm64/chrome-mac-arm64.zip |
chrome | mac-x64 | https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/119.0.6026.0/mac-x64/chrome-mac-x64.zip |
chrome | win32 | https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/119.0.6026.0/win32/chrome-win32.zip |
chrome | win64 | https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/119.0.6026.0/win64/chrome-win64.zip |
chromedriver | linux64 | https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/119.0.6026.0/linux64/chromedriver-linux64.zip |
chromedriver | mac-arm64 | https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/119.0.6026.0/mac-arm64/chromedriver-mac-arm64.zip |
chromedriver | mac-x64 | https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/119.0.6026.0/mac-x64/chromedriver-mac-x64.zip |
chromedriver | win32 | https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/119.0.6026.0/win32/chromedriver-win32.zip |
chromedriver | win64 | https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/119.0.6026.0/win64/chromedriver-win64.zip |
chrome-headless-shell | linux64 | https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/119.0.6026.0/linux64/chrome-headless-shell-linux64.zip |
chrome-headless-shell | mac-arm64 | https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/119.0.6026.0/mac-arm64/chrome-headless-shell-mac-arm64.zip |
chrome-headless-shell | mac-x64 | https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/119.0.6026.0/mac-x64/chrome-headless-shell-mac-x64.zip |
chrome-headless-shell | win32 | https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/119.0.6026.0/win32/chrome-headless-shell-win32.zip |
chrome-headless-shell | win64 | https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/119.0.6026.0/win64/chrome-headless-shell-win64.zip |
类别 | 平台 | 下载链接 |
---|---|---|
chrome | linux64 | https://storage.googleapis.com/chrome-for-testing-public/123.0.6312.122/linux64/chrome-linux64.zip |
chrome | mac-arm64 | https://storage.googleapis.com/chrome-for-testing-public/123.0.6312.122/mac-arm64/chrome-mac-arm64.zip |
chrome | mac-x64 | https://storage.googleapis.com/chrome-for-testing-public/123.0.6312.122/mac-x64/chrome-mac-x64.zip |
chrome | win32 | https://storage.googleapis.com/chrome-for-testing-public/123.0.6312.122/win32/chrome-win32.zip |
chrome | win64 | https://storage.googleapis.com/chrome-for-testing-public/123.0.6312.122/win64/chrome-win64.zip |
chromedriver | linux64 | https://storage.googleapis.com/chrome-for-testing-public/123.0.6312.122/linux64/chromedriver-linux64.zip |
chromedriver | mac-arm64 | https://storage.googleapis.com/chrome-for-testing-public/123.0.6312.122/mac-arm64/chromedriver-mac-arm64.zip |
chromedriver | mac-x64 | https://storage.googleapis.com/chrome-for-testing-public/123.0.6312.122/mac-x64/chromedriver-mac-x64.zip |
chromedriver | win32 | https://storage.googleapis.com/chrome-for-testing-public/123.0.6312.122/win32/chromedriver-win32.zip |
chromedriver | win64 | https://storage.googleapis.com/chrome-for-testing-public/123.0.6312.122/win64/chromedriver-win64.zip |
chromedriver版本 | 支持的Chrome版本 |
---|---|
v2.46 | v71-73 |
v2.45 | v70-72 |
v2.44 | v69-71 |
v2.43 | v69-71 |
v2.42 | v68-70 |
v2.41 | v67-69 |
v2.40 | v66-68 |
v2.39 | v66-68 |
v2.38 | v65-67 |
v2.37 | v64-66 |
v2.36 | v63-65 |
v2.35 | v62-64 |
v2.34 | v61-63 |
v2.33 | v60-62 |
v2.32 | v59-61 |
v2.31 | v58-60 |
v2.30 | v58-60 |
v2.29 | v56-58 |
v2.28 | v55-57 |
v2.27 | v54-56 |
v2.26 | v53-55 |
v2.25 | v53-55 |
v2.24 | v52-54 |
v2.23 | v51-53 |
v2.22 | v49-52 |
v2.21 | v46-50 |
v2.20 | v43-48 |
v2.19 | v43-47 |
v2.18 | v43-46 |
v2.17 | v42-43 |
v2.13 | v42-45 |
v2.15 | v40-43 |
v2.14 | v39-42 |
v2.13 | v38-41 |
v2.12 | v36-40 |
v2.11 | v36-40 |
v2.10 | v33-36 |
v2.9 | v31-34 |
v2.8 | v30-33 |
v2.7 | v30-33 |
v2.6 | v29-32 |
v2.5 | v29-32 |
v2.4 | v29-32 |
附: 所有chromedriver均可在下面链接中下载到:
http://chromedriver.storage.googleapis.com/index.html
现在有一点好的是出了按照chrome版本对应的driver,直接按照浏览器版本去找对应的driver(只对应大版本就行),不用再费心去对应了,大家可以尝试一下:
有些同学说下不了,到taobao下也是可以的:http://npm.taobao.org/mirrors/chromedriver/