Skip to main content

🚀 ChromeDriver Sync Manager

ChromeDriver Sync 是一个轻量级的 Python 工具,旨在解决自动化测试中最头疼的问题:Chrome 浏览器与驱动版本不匹配。

它会自动检测你电脑上安装的 Chrome 版本和系统架构(Windows/Mac/Linux),并从 dreamshao/chromedriver 镜像仓库中精准下载对应的驱动文件。


✨ 核心特性

  • 智能检测:自动识别本地 Chrome 版本(支持 v115+ 后的新架构)。
  • 全平台支持:支持 Windows (32/64)、macOS (Intel/M1/M2/M3)、Linux (64位)。
  • 交互式补救:如果找不到完全匹配的版本,会询问是否尝试下载最新的稳定版。
  • 速度优势:专为国内开发者优化,避开 Google 官方源连接不稳定的问题。

📦 安装方式

通过 pip 即可一键安装:

pip install chromedriver-sync

🛠 使用方法

安装完成后,直接在你的终端(Terminal/Command Prompt)输入以下命令:

chromedriver-sync

运行效果展示

  1. 自动匹配:程序会输出 检测到系统平台: mac-arm64 和 检测到 Chrome 版本: 121。
  2. 自动下载:匹配成功后自动下载压缩包。
  3. 解压就绪:驱动会解压到当前执行命令的目录下,你可以直接在代码中引用。

🐍 在 Python 代码中调用

如果你想在代码运行初期自动更新驱动,可以这样集成:

from chromedriver_sync.main import sync

# 运行同步逻辑,确保驱动是最新的
sync()

# 接下来启动你的 Selenium
from selenium import webdriver
driver = webdriver.Chrome()

❓ 常见问题 (FAQ)

Q: 为什么我运行后提示“未找到匹配版本”? A: 这通常是因为你的 Chrome 刚刚更新,而官方驱动尚未发布。此时输入 y 下载仓库中最新的版本,通常是可以向下兼容的。

Q: 如何将驱动安装到系统路径? A: 建议将下载后的 chromedriver 移动到 /usr/local/bin (Mac/Linux) 或将其所在文件夹添加到 Windows 的 PATH 环境变量中。


🌟 贡献与支持

如果你觉得这个工具有帮到你,请给 dreamshao/chromedriver 点一个 Star ⭐!这也是我持续更新驱动版本的动力。

Release files for chromedriver-sync 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for chromedriver-sync 1.0.1
File Size Uploaded
chromedriver_sync-1.0.1.tar.gz 4.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for chromedriver-sync 1.0.1
File Interpreter ABI Platform
chromedriver_sync-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 10.2 kB

Release files / chromedriver_sync-1.0.1.tar.gz

Download URL chromedriver_sync-1.0.1.tar.gz
Size 4.9 kB
Tags Source
SHA-256 checksum
How to use checksums
ac9635623caffc5738666ea0055da78b7947aa3dc05df65beba33885afa99c6f
BLAKE2b-256 checksum
How to use checksums
95e2266015a6c8f687d546888d03828c0e6e550b6c95fb10a1cfe7940f0dfdd2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.5

Release files / chromedriver_sync-1.0.1-py3-none-any.whl

Download URL chromedriver_sync-1.0.1-py3-none-any.whl
Size 5.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bc92c8a0e15dd2e8630a167e9a7e782b1820cd549abff207585a7cad1817ac06
BLAKE2b-256 checksum
How to use checksums
401743c1f1d07390c193d3dc66c562a0a9e668009f98fe4471e2e7fd6fb4bdbf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.5

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page