Chromedriver c# - 没有合适的构造函数

Chromedriver c# - no suitable constructor

大家好,我如何 运行 带有 SERVICE、OPTIONS、PATH 的 Chromedriver?

我有 8 个可用的构造函数,但没有一个是用于这 3 个参数的。

感谢您的回答。

我需要这个,我该如何实现?

public ChromeDriver(string chromeDriverDirectory,ChromeDriver service, 
ChromeOptions options);

没有接受 SERVICE、OPTIONS、PATH 的构造函数。
与您要找的最相似的是这个:

public ChromeDriver(ChromeDriverService service, ChromeOptions options);;

用法:

var chromeOptions = new ChromeOptions();

// Your configuration
// e.g. options.AddArgument("--disable-popup-blocking");

var driver = new ChromeDriver(ChromeDriverService.CreateDefaultService("PATH"), chromeOptions);