You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Mac ARM平台Selenium打开网站出现证书错误问题求助

Mac ARM平台Selenium + Chrome 115+ 证书错误问题解决

问题背景

在Mac ARM架构环境下使用Python Selenium:

  • Chrome 115版本发布前,ChromeDriver与Selenium配合正常,所有网站均可正常访问
  • Chrome升级至115+后出现证书错误,使用options.add_argument('--ignore-certificate-errors')可临时绕过,但会带来安全风险,且部分网站的运行逻辑会因证书状态不同而异常
  • 已尝试的排查动作:重装/更新Chrome、ChromeDriver、seleniumwire、undetected_chromedriver、Python;降级Chrome到110版本,问题仍未解决

可行解决方案

  • 严格匹配Chrome与ChromeDriver版本:Chrome 115版本后,ChromeDriver的分发渠道变更为Chrome for Testing,需下载对应Mac ARM架构的驱动包,确保版本号与Chrome完全一致(包括小版本)
  • 手动信任代理工具证书:如果使用seleniumwire等带代理功能的库,其生成的CA证书未被系统信任会导致证书错误。打开Mac钥匙串访问,将seleniumwire生成的CA证书添加到系统钥匙串,并设置为“始终信任”
  • 精准配置证书忽略参数:替代全局忽略证书的参数,使用更精准的选项:
    • 针对本地站点:options.add_argument('--allow-insecure-localhost')
    • 针对特定证书:options.add_argument('--ignore-certificate-errors-spki-list=证书指纹'),仅信任指定证书,降低安全风险
  • 调整undetected_chromedriver配置:确保使用最新版undetected_chromedriver,初始化时关闭内置代理干扰,或配置其加载系统信任证书:
    from undetected_chromedriver import Chrome, ChromeOptions
    
    options = ChromeOptions()
    options.add_argument('--use-system-ssl-certificates')
    driver = Chrome(options=options)
    

内容的提问来源于stack exchange,提问作者letsolum

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.13 05:45:00