報錯:selenium.common.exceptions.WebDriverException: Message: unknown error: cannot find Chrome binary
阿新 • • 發佈:2018-12-06
C:\Users\哀鳴嘯天>chromedriver
Starting ChromeDriver 2.28.455520 (cc17746adff54984afff480136733114c6b3704b) on port 9515
Only local connections are allowed.
^C
C:\Users\哀鳴嘯天>
C:\Users\哀鳴嘯天>python
Python 3.6.0 |Anaconda 4.3.1 (64-bit)| (default, Dec 23 2016, 11:57:41) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from selenium import webdriver
>>> driver = webdriver.Chrome()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "E:\Anaconda3\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 75, in __init__
desired_capabilities=desired_capabilities)
File "E:\Anaconda3\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 156, in __init__
self.start_session(capabilities, browser_profile)
File "E:\Anaconda3\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 251, in start_session
response = self.execute(Command.NEW_SESSION, parameters)
File "E:\Anaconda3\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 320, in execute
self.error_handler.check_response(response)
File "E:\Anaconda3\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
(Driver info: chromedriver=2.28.455520 (cc17746adff54984afff480136733114c6b3704b),platform=Windows NT 10.0.17134 x86_6
4)
我的電腦是win10,64位系統。
學習chromedriver時,在cmd窗口出現了以上問題。從網上找了些辦法,都不管用。
電腦上已經裝了最新版QQ瀏覽器。也許是因為QQ瀏覽器採用的是Chromium和IE,
和chromedriver需要的環境不一致,所以會報錯。
解決辦法:安裝google瀏覽器。
我的Google瀏覽器版本及路徑: