如何使用selenium web驱动程序处理chrome浏览器中弹出的身份验证?
尝试:
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/capabilitieshttps://chromium.googlesource.com/chromium/src/+/master/docs/user_data_dir.md