You need to enable JavaScript to run this app. Mac系统运行Selenium出现chrome not reachable异常该如何解决?
优惠活动
大模型
产品
解决方案
定价
更多

Mac系统运行Selenium出现chrome not reachable异常该如何解决?

chrome not reachable 报错解决方案

该报错的核心原因是ChromeDriver无法和本地Chrome浏览器建立正常通信,可按以下步骤逐一排查解决:

1. 校验版本匹配关系

  • 打开本地Chrome浏览器,地址栏输入chrome://version查看当前Chrome的大版本号(如116、117这类主版本数字)
  • 确认你存放在/Users/Kudzie/Tools/chromedriver的驱动主版本和Chrome浏览器主版本完全一致,版本不匹配是触发该报错的最高频原因

2. 修复ChromeDriver的Mac系统权限

Mac系统默认会限制第三方未签名工具的执行权限,打开终端依次执行以下命令:

# 给驱动添加可执行权限
chmod +x /Users/Kudzie/Tools/chromedriver
# 移除系统安全隔离限制
xattr -d com.apple.quarantine /Users/Kudzie/Tools/chromedriver

3. 适配高版本Selenium的语法

Selenium 4.x以上版本已不推荐直接传递驱动路径给Chrome构造方法,调整你的代码为以下兼容写法:

from selenium import webdriver
from selenium.webdriver.chrome.service import Service

PATH = "/Users/Kudzie/Tools/chromedriver"
s = Service(executable_path=PATH)
options = webdriver.ChromeOptions()
# 规避系统环境限制的必要参数
options.add_argument('--no-sandbox')
options.add_argument('--disable-dev-shm-usage')
# 若本地安装了多版本Chrome,可手动指定浏览器路径
# options.binary_location = "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"

driver = webdriver.Chrome(service=s, options=options)
driver.get('https://orbitrevolution.tech')

4. 额外排查项

  • 确认本地防火墙、代理工具没有拦截ChromeDriver和Chrome的本地通信,可临时关闭这类工具再测试
  • 确认本地没有同时安装多个Chrome渠道版本(稳定版、开发版、测试版共存),避免驱动匹配到错误的浏览器程序

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.10.20 00:36:07