在chromedriver中使用硒时出现问题

问题描述

将硒与chromedriver一起使用时出现问题。 设置Selenium,goggle-chrome和chromedriver后,在python3.5中运行简单代码时出现此错误

selenium.common.exceptions.SessionNotCreatedException: Message: session not created
from chrome not reachable
  (Session info: chrome=85.0.4183.102)

这是代码

#!/usr/bin/python3.5
from selenium import webdriver
from selenium.webdriver.chrome.options import Options

test_url = 'https://www.python.org'

binary_location = '/usr/bin/google-chrome-stable'
driver_location = '/usr/bin/chromedriver'

chrome_options = Options()
chrome_options.binary_location = binary_location
driver = webdriver.Chrome(executable_path=driver_location,chrome_options=chrome_options)
driver.get(test_url)
print(driver.title)
driver.quit()

我使用Debian9在Linux上工作

google-version:85.0.4183.102

chromedriver:85.0.4183.87

两年前,我毫无疑问地使用了Selenium。从其他方面来看,该错误似乎与google-chrome和chromedriver之间的兼容性问题有关。但是,看看它们的版本,我应该不会出现此错误。我删除了google-chrome和chromedriver并重新安装它们,但仍然没有问题。

有什么主意吗? 感谢您的帮助。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)