Python Selenium 未知错误

标签 python python-2.7 selenium

我有一个 python 代码,大约每月在我的 Windows 计算机上运行一次,

from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import Select  

driver = webdriver.Chrome() 
driver.get('url')

上次我运行它时一切都很好,但今天我得到了这个

WebDriverException: Message: u'unknown error: Runtime.executionContextCreated has invalid 
\'context\': {"auxData":{"frameId":"184.1","isDefault":true},
"id":1,"name":"","origin":"://"}\n  (Session info: chrome=54.0.2840.71)\n  
(Driver info: chromedriver=2.9.248315,platform=Windows NT 6.1 SP1 x86_64)'

我尝试重新安装selenium,但这没有改变任何东西。 我没有包含完整的代码,因为它从一开始就中断了。 任何输入都会有帮助

最佳答案

当驱动程序版本和浏览器版本不同步时,通常会引发此错误 - 您需要升级 chromedriver 或降级 Chrome。

关于Python Selenium 未知错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40411413/

相关文章:

python - 格式化 pandas 中的数据

python - 使用 set on zip lists 删除重复项

python - 是否可以在 python splinter 中隐藏浏览器窗口(Windows、Linux)?

python - 使用 Seaborn tsplot 绘制不同时间序列

python - 当我尝试打开 MongoDB 窗口时自动关闭

python - Pandas group by 正在删除完成分组的维度

python - 通过脚本更改 Chrome 首选项

python - Selenium 无法打开指定的 URL 并显示数据 :,

使用嵌入列表的python队列

python - 同一列中的行元素对出现的次数