我有一个 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/