当我通过 webdriver 下载时,出现“失败 - 下载错误”,但是,手动(在没有 webdriver 的浏览器中)我可以正常下载。
什么样的问题可以?
调用下载的操作只是单击按钮,没什么特别的。
下面,我的实例ChromeDriver();
var chromeOptions = new ChromeOptions();
if (SilentMode)
{
chromeOptions.AddArguments("headless", "disable-gpu", "silent-launch", "no-startup-window", "incognito");
}
chromeOptions.AddArguments("disable-web-security", "disable-popup-blocking", "AcceptInsecureCertificates", "auth-server-whitelist=*", "no-sandbox", "disable-notifications", "disable-single-click-autofill");
chromeOptions.AddUserProfilePreference("download.default_directory", CaminhoDownload);
chromeOptions.AddUserProfilePreference("download.prompt_for_download", false);
Driver = new ChromeDriver(chromeOptions);
NomeProcessoDriver = "chromedriver";
白板的微信
相关分类