报错:selenium.common.exceptions.WebDriverException: Message: unknown error: cannot find Chrome binary

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 "", line 1, in 
  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)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浏览器版本及路径:

报错:selenium.common.exceptions.WebDriverException: Message: unknown error: cannot find Chrome binary_第1张图片

你可能感兴趣的:(python爬虫)