weixin_43003324
weixin_43003324
采纳率90%
2018-11-13 13:10 阅读 2.1k

请问,是selenium 与webdriver版本不一致引起的错误,还是?

from selenium import webdriver
chromedriver = 'D:\Program Files (x86)\ChromeCore\chromedriver.exe'#chromedriver是2.38 win32版本,ChromeCore是65版本
url = 'http://www.baidu.com/'
browser = webdriver.Chrome(executable_path=chromedriver)
browser.get(geturl)

反馈结果是:Traceback (most recent call last):
File "", line 4, in
File "C:\Users\Administrator\PycharmProjects\untitled\venv\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 81, in init
desired_capabilities=desired_capabilities)
File "C:\Users\Administrator\PycharmProjects\untitled\venv\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 157, in init
self.start_session(capabilities, browser_profile)
File "C:\Users\Administrator\PycharmProjects\untitled\venv\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 252, in start_session
response = self.execute(Command.NEW_SESSION, parameters)
File "C:\Users\Administrator\PycharmProjects\untitled\venv\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "C:\Users\Administrator\PycharmProjects\untitled\venv\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.38.552522 (437e6fbedfa8762dec75e2c5b3ddb86763dc9dcb),platform=Windows NT 6.1.7601 SP1 x86_64)

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

2条回答 默认 最新

  • 已采纳
    weixin_43003324 weixin_43003324 2018-11-15 12:00

    最后下载了一个老版的chrome浏览器及一个相配套的chromedriver 安装到c盘同一个目录中,就搞定了

    点赞 评论 复制链接分享
  • qq_43258883 qq_43258883 2018-11-14 02:28
    点赞 评论 复制链接分享

相关推荐