最为关键的一点是:如何找到对应 Chrome 版本的 chrome driver

笔者的 Chrome 版本为 137.0.7151.120。

首先登录 ChromeDriver 下载地址:链接

然后会发现只有 114 version 及更早的,页面上有陈述:

If you are using Chrome version 115 or newer, please consult the Chrome for Testing availability dashboard. This page provides convenient JSON endpoints for specific ChromeDriver version downloading.

点击链接,会发现找不到想要的版本,那么到底在哪里呢?

Consult our JSON API endpoints if you’re looking to build automated scripts based on Chrome for Testing release data.

点击对应链接,页面又跳转到了 github 上,有这样一个表格:

alt text

那么,究竟什么是 Json API endpoints,我们又该怎么使用?

简单理解呢,就是提供了一系列信息,这些信息的组织结构是 JSON 形式的,且满足一定的标准,可以方便开发者自动化提取信息,因此可以认为是接口,也就是 JSON API,那么所谓 endpoints,指的是网络接口的访问地址,通过这些地址可以访问到对应的服务和资源。那么这些东西对应的域名和路径是什么?那就要看是哪个网站提供的 api 了,显然是这个网站:

This page provides convenient JSON endpoints for specific ChromeDriver version downloading.

因此我们只需要访问:这个网址就可以得到我们想要的对应版本的 ChromeDriver 了。