通过selenium在firefox中打开私有模式
其实我想通过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");
有人可以帮忙怎么做?
- 使用Selenium 3.0启动Firefox 46.0.1时获取IllegalStateException
- 来自Selenium 2 / WebDriver的Id的jQuery元素选择器
- 使用selenium java在firefox gecko驱动程序中自动下载pdf
- 45000 ms后无法在端口7055上连接到主机127.0.0.1。 用FF版26.0和selenium独立jar2.39
- Selenium Webdriver:在firefox中抑制不受信任的连接消息
- SessionNotCreatedException:无法创建新服务:在Ubuntu上使用Selenium Grid的GeckoDriverService无法驱动Firefox
- Java Web Start Applet打开新的浏览器窗口/选项卡忽略目标
- 在PATH中找不到firefox二进制文件。 确保安装了firefox。 操作系统似乎是:VISTA
- Selenium / Firefox:命令“.click()”不适用于找到的元素