实际上我想通过selenium打开firefox浏览器的隐身/私密模式,但每次我尝试时都是以正常模式打开firefox。
经过一番谷歌搜索后,我得到了这段代码,我用它通过 selenium 在 Firefox 中打开私有模式,但它不起作用。
FirefoxProfile firefoxProfile = new FirefoxProfile();
firefoxProfile.setPreference("browser.privatebrowsing.autostart", true);
WebDriver driver = new FirefoxDriver(firefoxProfile);
driver.get("http://www.google.com");
有人可以帮忙怎么做吗?
None
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)