FirefoxOptions options3 = new FirefoxOptions();
options3.setHeadless(false);
options3.addArguments("profile","C:\\Users\\Administrator\\AppData\\Roaming\\Mozilla\\Firefox\\Profiles\\i8k6kx4s.default");
WebDriver driver3 = new FirefoxDriver(options3);false);
Thread.sleep(1000);
driver3.get("https://ramdonwebsit.com");
它会打开个人资料,但不会访问网站。我正在尝试加载一个保存了缓存数据和密码的特定配置文件,这样我就可以直接访问该网站并避免出现带有验证码的登录问题。
最佳答案
尝试以下 -
ProfilesIni profile = new ProfilesIni();
FirefoxProfile myprofile = profile.getProfile("Your_Profile");
WebDriver driver = new FirefoxDriver(myprofile);
Thread.sleep(1000);
driver.get("https://ramdonwebsit.com");
关于java - Selenium Firefox 加载配置文件,但 Web 驱动程序部分不再工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56324614/