我正在使用 Selenium C#,尝试禁用“崩溃”Chrome的弹出窗口:
![https://istack.dev59.com/xudon.webp](https://istack.dev59.com/xudon.webp)
我尝试设置配置文件偏好设置,但似乎根本没有改变,代码如下:
ChromeOptions options = new ChromeOptions();
options.AddUserProfilePreference("exit_type", "Normal");
options.AddUserProfilePreference("exited_cleanly", "true");
IWebDriver driver = new ChromeDriver(options);
我试图将退出类型的值更改为none和None,但在首选项文档中没有任何改变。
options.AddArguments("--disable-application-cache");
。基本上针对您的问题,options.AddArguments("--disable-extensions");
这个选项就足够了。 - Raj