换源/ChromeDriver / 浏览器二进制
ChromeDriver / 浏览器二进制 镜像源
ChromeDriver、Chrome for Testing、Playwright / Puppeteer 浏览器二进制国内镜像,Selenium / 自动化测试提速。
可用镜像源(5)
| 源 | 地址 | 说明 |
|---|---|---|
| npmmirror chromedriver | https://registry.npmmirror.com/-/binary/chromedriver/ | 推荐 |
| 华为 chromedriver | https://repo.huaweicloud.com/chromedriver/ | 全版本 |
| npmmirror chrome-for-testing | https://registry.npmmirror.com/-/binary/chrome-for-testing/ | 新版 Chrome + driver |
| npmmirror playwright | https://registry.npmmirror.com/-/binary/playwright/ | Playwright 浏览器 |
| 官方 | https://googlechromelabs.github.io/chrome-for-testing/ | 还原时使用 |
换源方法
下载 ChromeDriver
wget https://registry.npmmirror.com/-/binary/chromedriver/126.0.6478.126/chromedriver_linux64.zipPuppeteer 跳过自带下载 / 指定镜像
export PUPPETEER_DOWNLOAD_BASE_URL=https://registry.npmmirror.com/-/binary/chrome-for-testing/
# 或完全跳过:export PUPPETEER_SKIP_DOWNLOAD=truePlaywright 浏览器镜像
export PLAYWRIGHT_DOWNLOAD_HOST=https://registry.npmmirror.com/-/binary/playwright/
npx playwright install chromium使用提示
- ·公共 registry 加速器时效性强(2024 后大量关停),失效就换节点或自建缓存。
- ·私有镜像需鉴权,token 不要经第三方镜像中转。
- ·生产环境尽量用 digest 或锁定 tag,避免 tag 漂移。
- ·大文件/多层镜像可配 registry:2 proxy 自建缓存,一次拉取长期复用。