最近,我的chrome版本已从75版本更新为77.0.3865.120(64位)。我的程序以前可以与版本75和与75相关的chrome驱动程序一起使用,现在我的chrome浏览器已更新为77.0.3865.120(64位),但出现以下错误消息
**An unhandled exception of type 'System.InvalidOperationException' occurred in WebDriver.dll
Additional information: invalid argument: entry 0 of 'firstMatch' is invalid
from invalid argument: unrecognized capability: chromeOptions**
这是我的代码:
ChromeOptions chromeOptions = new ChromeOptions();
chromeOptions.AddArguments("window-size=800,600");
chromeOptions.AddArgument("no-sandbox");
DesiredCapabilities capabilities = DesiredCapabilities.Chrome();
capabilities.SetCapability(ChromeOptions.Capability, chromeOptions);
using (IWebDriver driver = new ChromeDriver("local path to driver", chromeOptions)) -- error at this line
答案 0 :(得分:0)
如果您使用的是Google Chrome 77.00版本,则需要下载 Chromedriver 77.00,以下是链接: https://chromedriver.storage.googleapis.com/index.html?path=77.0.3865.40/