【发布时间】:2022-01-17 08:49:48
【问题描述】:
我在尝试运行我的代码时收到此错误,请告诉我我能做什么。如果需要,我会在这里发布完整的代码。
Traceback (most recent call last):
File "C:\Users\hp\Desktop\FB\GUI.py", line 104, in <module>
main()
File "C:\Users\hp\Desktop\FB\GUI.py", line 65, in main
driver = webdriver.Chrome(options=options)
File "C:\Users\hp\AppData\Local\Programs\Python\Python310\lib\site-
packages\selenium\webdriver\chrome\webdriver.py", line 70, in __init__
super(WebDriver, self).__init__(DesiredCapabilities.CHROME['browserName'], "goog",
File "C:\Users\hp\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\chromium\webdriver.py", line 93, in __init__
RemoteWebDriver.__init__(
File "C:\Users\hp\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 268, in __init__
self.start_session(capabilities, browser_profile)
File "C:\Users\hp\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 359, in start_session
response = self.execute(Command.NEW_SESSION, parameters)
File "C:\Users\hp\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 424, in execute
self.error_handler.check_response(response)
File "C:\Users\hp\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 247, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: cannot find Chrome binary
(Driver info: chromedriver=2.43.600210 (68dcf5eebde37173d4027fa8635e332711d2874a),platform=Windows NT 10.0.19042 x86_64)
【问题讨论】:
-
请发布一个导致您的问题的可重现的小代码
-
欢迎来到 Stack Overflow。请阅读How to Ask。我们只能告诉您您向我们展示的代码有什么问题。请参阅stackoverflow.com/help/minimal-reproducible-example,这样我们就不必对完整代码进行排序。另请阅读meta.stackoverflow.com/questions/284236 - “让我知道我能做什么”不是一个可操作的问题。 “为什么我会收到此错误,我该如何解决?”有效,但只有在你 tried to figure it out yourself first - which includes reading documentation 之后。
标签: python selenium google-chrome selenium-webdriver