raise exception_class(message, screen, stacktrace) selenium.common.exceptions.webdriverexception: message: unknown error: cannot find chrome binary

时间: 2023-05-01 21:03:47 浏览: 114
这是一个关于Selenium的错误信息,意思是无法找到Chrome浏览器的二进制文件。可能是Chrome浏览器没有安装或安装路径不正确导致无法被Selenium找到。需要检查Chrome浏览器的安装情况,或者在Selenium配置中更新Chrome浏览器的路径。
相关问题

raise exception_class(message, screen, stacktrace) selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 112 Current browser version is 114.0.5735.110 with binary path C:\Program Files\Google\Chrome\Application\chrome.exe

这个错误是由于您的ChromeDriver版本与Chrome浏览器版本不匹配导致的。ChromeDriver只支持特定版本的Chrome浏览器,如果您的Chrome浏览器版本与ChromeDriver版本不匹配,则会出现此错误。 您需要下载与您Chrome浏览器版本匹配的ChromeDriver,然后将其放置在系统路径下,或者在代码中指定ChromeDriver的路径。您可以在ChromeDriver的官方网站上下载您需要的版本。 如果您使用的是Python,可以使用以下代码指定ChromeDriver路径: ``` from selenium import webdriver driver = webdriver.Chrome('/path/to/chromedriver') ``` 其中,`/path/to/chromedriver`是您的ChromeDriver的路径。

Traceback (most recent call last): File "D:\pythonProject\main.py", line 2, in <module> driver=webdriver.Chrome() # 驱动谷歌 File "C:\Users\dyh\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 76, in __init__ RemoteWebDriver.__init__( File "C:\Users\dyh\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 157, in __init__ self.start_session(capabilities, browser_profile) File "C:\Users\dyh\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 252, in start_session response = self.execute(Command.NEW_SESSION, parameters) File "C:\Users\dyh\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute self.error_handler.check_response(response) File "C:\Users\dyh\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.WebDriverException: Message: unknown error: cannot find Chrome binary

这个错误是由于Selenium无法找到Chrome浏览器的可执行文件导致的。为了解决这个问题,你需要指定Chrome浏览器的路径。 你可以按照以下步骤进行操作: 1. 打开Chrome浏览器,并找到它的安装路径。在Windows上,默认情况下,它通常安装在`C:\Program Files (x86)\Google\Chrome\Application`目录下。在Mac上,它通常安装在`/Applications/Google Chrome.app`目录下。 2. 在你的Python代码中,使用`ChromeOptions`类来指定Chrome浏览器的路径。例如: ```python from selenium import webdriver chrome_options = webdriver.ChromeOptions() chrome_options.binary_location = "C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe" # Windows路径 driver = webdriver.Chrome(options=chrome_options) ``` 如果你使用的是Mac,将`binary_location`设置为适当的路径即可。 3. 现在,尝试重新运行你的代码,应该不再出现`unknown error: cannot find Chrome binary`的错误。 希望这可以解决你的问题!如果还有其他疑问,请随时提问。

相关推荐

Python 3.10.11 (tags/v3.10.11:7d4cc5a, Apr 5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license()" for more information. ===================== RESTART: G:\chashan\python案例\爬虫案例.py ===================== Traceback (most recent call last): File "G:\chashan\python案例\爬虫案例.py", line 3, in <module> driver = webdriver.Chrome() File "G:\chashan\python\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 84, in __init__ super().__init__( File "G:\chashan\python\lib\site-packages\selenium\webdriver\chromium\webdriver.py", line 104, in __init__ super().__init__( File "G:\chashan\python\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 286, in __init__ self.start_session(capabilities, browser_profile) File "G:\chashan\python\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 378, in start_session response = self.execute(Command.NEW_SESSION, parameters) File "G:\chashan\python\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 440, in execute self.error_handler.check_response(response) File "G:\chashan\python\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 245, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.WebDriverException: Message: unknown error: cannot find Chrome binary Stacktrace: Backtrace: GetHandleVerifier [0x010F8893+48451] (No symbol) [0x0108B8A1] (No symbol) [0x00F95058] (No symbol) [0x00FB164E] (No symbol) [0x00FB0019] (No symbol) [0x00FE0798] (No symbol) [0x00FE047C] (No symbol) [0x00FDA0B6] (No symbol) [0x00FB7E08] (No symbol) [0x00FB8F2D] GetHandleVerifier [0x01358E3A+2540266] GetHandleVerifier [0x01398959+2801161] GetHandleVerifier [0x0139295C+2776588] GetHandleVerifier [0x01182280+612144] (No symbol) [0x01094F6C] (No symbol) [0x010911D8] (No symbol) [0x010912BB] (No symbol) [0x01084857] BaseThreadInitThunk [0x75587D59+25] RtlInitializeExceptionChain [0x76FBB74B+107] RtlClearBits [0x76FBB6CF+191]

解决一下这个问题Traceback (most recent call last): File "D:\pythonchengxu\untitled12\zuoye.py", line 12, in <module> driver = webdriver.Chrome(options=chrome_options) File "D:\Program Files\Python39\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 69, in __init__ super().__init__(DesiredCapabilities.CHROME['browserName'], "goog", File "D:\Program Files\Python39\lib\site-packages\selenium\webdriver\chromium\webdriver.py", line 92, in __init__ super().__init__( File "D:\Program Files\Python39\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 270, in __init__ self.start_session(capabilities, browser_profile) File "D:\Program Files\Python39\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 363, in start_session response = self.execute(Command.NEW_SESSION, parameters) File "D:\Program Files\Python39\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 428, in execute self.error_handler.check_response(response) File "D:\Program Files\Python39\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 243, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 112 Current browser version is 114.0.5735.110 with binary path C:\Program Files\Google\Chrome\Application\chrome.exe Stacktrace: Backtrace: GetHandleVerifier [0x00B9DCE3+50899] (No symbol) [0x00B2E111] (No symbol) [0x00A35588] (No symbol) [0x00A5570C] (No symbol) [0x00A51471] (No symbol) [0x00A4F479] (No symbol) [0x00A81FFE] (No symbol) [0x00A81CEC] (No symbol) [0x00A7B6F6] (No symbol) [0x00A57708] (No symbol) [0x00A5886D] GetHandleVerifier [0x00E03EAE+2566302] GetHandleVerifier [0x00E392B1+2784417] GetHandleVerifier [0x00E3327C+2759788] GetHandleVerifier [0x00C35740+672048] (No symbol) [0x00B38872] (No symbol) [0x00B341C8] (No symbol) [0x00B342AB] (No symbol) [0x00B271B7] BaseThreadInitThunk [0x76847D59+25] RtlInitializeExceptionChain [0x77B6B74B+107] RtlClearBits [0x77B6B6CF+191]

最新推荐

recommend-type

计算机专业毕业设计范例845篇jsp2118基于Web停车场管理系统的设计与实现_Servlet_MySql演示录像.rar

博主给大家详细整理了计算机毕业设计最新项目,对项目有任何疑问(部署跟文档),都可以问博主哦~ 一、JavaWeb管理系统毕设项目【计算机毕设选题】计算机毕业设计选题,500个热门选题推荐,更多作品展示 计算机毕业设计|PHP毕业设计|JSP毕业程序设计|Android毕业设计|Python设计论文|微信小程序设计
recommend-type

Windows 10 平台 FFmpeg 开发环境搭建 博客资源

【FFmpeg】Windows 10 平台 FFmpeg 开发环境搭建 ④ ( FFmpeg 开发库内容说明 | 创建并配置 FFmpeg 项目 | 拷贝 DLL 动态库到 SysWOW64 目录 ) https://hanshuliang.blog.csdn.net/article/details/139172564 博客资源 一、FFmpeg 开发库 1、FFmpeg 开发库编译 2、FFmpeg 开发库内容说明 二、创建并配置 FFmpeg 项目 1、拷贝 dll 动态库到 C:\Windows\SysWOW64 目录 - 必须操作 特别关注 2、创建 Qt 项目 - C 语言程序 3、配置 FFmpeg 开发库 - C 语言项目 4、创建并配置 FFmpeg 开发库 - C++ 项目
recommend-type

基于 Spring Cloud 、Spring Boot、 OAuth2 的 RBAC 企业快速开发平台

基于 Spring Cloud 、Spring Boot、 OAuth2 的 RBAC 企业快速开发平台, 同时支持微服务架构和单体架构。提供对 Spring Authorization Server 生产级实践,支持多种安全授权模式。提供对常见容器化方案支持 Kubernetes、Rancher2 、Kubesphere、EDAS、SAE 支持
recommend-type

zigbee-cluster-library-specification

最新的zigbee-cluster-library-specification说明文档。
recommend-type

管理建模和仿真的文件

管理Boualem Benatallah引用此版本:布阿利姆·贝纳塔拉。管理建模和仿真。约瑟夫-傅立叶大学-格勒诺布尔第一大学,1996年。法语。NNT:电话:00345357HAL ID:电话:00345357https://theses.hal.science/tel-003453572008年12月9日提交HAL是一个多学科的开放存取档案馆,用于存放和传播科学研究论文,无论它们是否被公开。论文可以来自法国或国外的教学和研究机构,也可以来自公共或私人研究中心。L’archive ouverte pluridisciplinaire
recommend-type

MySQL数据库性能提升秘籍:揭秘性能下降幕后真凶及解决策略

![MySQL数据库性能提升秘籍:揭秘性能下降幕后真凶及解决策略](http://xiaoyuge.work/explain-sql/index/2.png) # 1. MySQL数据库性能优化概述** MySQL数据库性能优化是一项至关重要的任务,可以显著提高应用程序的响应时间和整体用户体验。优化涉及识别和解决影响数据库性能的因素,包括硬件资源瓶颈、软件配置不当和数据库设计缺陷。通过采取适当的优化策略,可以显著提升数据库性能,满足业务需求并提高用户满意度。 # 2. MySQL数据库性能下降的幕后真凶 ### 2.1 硬件资源瓶颈 #### 2.1.1 CPU利用率过高 **症状:
recommend-type

如何在unity创建按钮

在 Unity 中创建按钮的步骤如下: 1. 在 Unity 中创建一个 UI Canvas,选择 GameObject -> UI -> Canvas。 2. 在 Canvas 中创建一个按钮,选择 GameObject -> UI -> Button。 3. 在场景视图中调整按钮的位置和大小。 4. 在 Inspector 中设置按钮的文本、颜色、字体等属性。 5. 添加按钮的响应事件,选择按钮,在 Inspector 的 On Click () 中添加相应的方法。 这样就可以创建一个按钮了,你可以在游戏中使用它来触发相应的操作。
recommend-type

JSBSim Reference Manual

JSBSim参考手册,其中包含JSBSim简介,JSBSim配置文件xml的编写语法,编程手册以及一些应用实例等。其中有部分内容还没有写完,估计有生之年很难看到完整版了,但是内容还是很有参考价值的。
recommend-type

"互动学习:行动中的多样性与论文攻读经历"

多样性她- 事实上SCI NCES你的时间表ECOLEDO C Tora SC和NCESPOUR l’Ingén学习互动,互动学习以行动为中心的强化学习学会互动,互动学习,以行动为中心的强化学习计算机科学博士论文于2021年9月28日在Villeneuve d'Asq公开支持马修·瑟林评审团主席法布里斯·勒菲弗尔阿维尼翁大学教授论文指导奥利维尔·皮耶昆谷歌研究教授:智囊团论文联合主任菲利普·普雷教授,大学。里尔/CRISTAL/因里亚报告员奥利维耶·西格德索邦大学报告员卢多维奇·德诺耶教授,Facebook /索邦大学审查员越南圣迈IMT Atlantic高级讲师邀请弗洛里安·斯特鲁布博士,Deepmind对于那些及时看到自己错误的人...3谢谢你首先,我要感谢我的两位博士生导师Olivier和Philippe。奥利维尔,"站在巨人的肩膀上"这句话对你来说完全有意义了。从科学上讲,你知道在这篇论文的(许多)错误中,你是我可以依
recommend-type

表锁问题全解析,深度解读MySQL表锁问题及解决方案

![表锁问题全解析,深度解读MySQL表锁问题及解决方案](https://img-blog.csdnimg.cn/img_convert/a89711a10f6b856a777a9eed389c5112.png) # 1. 表锁基础** 表锁是一种数据库并发控制机制,用于防止多个事务同时访问和修改同一行或表中的数据,从而保证数据的完整性和一致性。表锁通过对表或表中的特定行施加锁来实现,以确保在事务完成之前,其他事务不能对这些数据进行修改。 表锁分为两种主要类型:共享锁(S锁)和排他锁(X锁)。共享锁允许多个事务同时读取同一行或表中的数据,但不能修改。排他锁则允许一个事务独占地访问和修改同