如何使用Selenium Web驱动程序处理Chrome浏览器中弹出的身份验证?
答案 0 :(得分:0)
尝试:
WebDriver driver = new ChromeDriver(options)
driver.get("http://username:password@www.domain.com");
或
ChromeOptions options = new ChromeOptions();
options.addArguments("user-data-dir=/path/to/your/custom/profile");
WebDriver driver = new ChromeDriver(options);
driver.navigate().to(testURL);
参考文献:
https://sites.google.com/a/chromium.org/chromedriver/capabilities https://chromium.googlesource.com/chromium/src/+/master/docs/user_data_dir.md