【发布时间】:2019-09-12 01:18:39
【问题描述】:
我正在尝试使用 Python 3 将 Selenium 与 Google Chrome 一起使用,如下所示:
chromedriver = "/usr/local/bin/chromedriver"
chrome_options = Options()
chrome_options.add_argument('--disable-dev-shm-usage')
chrome_options.add_argument('--no-sandbox')
chrome_options.add_argument('--ignore-certificate-errors')
chrome_options.binary_location = '/usr/bin/google-chrome'
browser = webdriver.Chrome(chromedriver, options=chrome_options)
上面的代码给出了错误信息:
selenium.common.exceptions.SessionNotCreatedException:消息: 未创建会话:此版本的 ChromeDriver 仅支持 Chrome 版本 77
但chromedriver 和google-chrome 都是77 版。
$ /usr/local/bin/chromedriver --version
ChromeDriver 77.0.3865.40 (f484704e052e0b556f8030b65b953dce96503217-refs/branch-heads/3865@{#442})
$ /usr/bin/google-chrome --version
Google Chrome 77.0.3865.75
【问题讨论】:
-
Python 版本
3.?请完整的错误堆栈跟踪。
标签: python-3.x selenium google-chrome selenium-chromedriver