0
我想禁用“禁用开发模式扩展”弹出,同时保持一个扩展在这篇文章中提到keep "Disable developer mode" closed while adding extension硒禁用“禁用开发模式扩展”弹出当添加扩展
有没有答案,我想做同样的事情。有没有像Selenium这样的铬选项?
我想禁用“禁用开发模式扩展”弹出,同时保持一个扩展在这篇文章中提到keep "Disable developer mode" closed while adding extension硒禁用“禁用开发模式扩展”弹出当添加扩展
有没有答案,我想做同样的事情。有没有像Selenium这样的铬选项?
这里是回答你的问题:
通过Java绑定使用Selenium 3.4.0,chromedriver V2.30工作时,谷歌Chrome 59.0,您可以使用ChromeOption类禁用“禁用开发模式扩展“弹出如下:
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;
public class Q44959944_dev_extn {
public static void main(String[] args) {
System.setProperty("webdriver.chrome.driver", "C:\\Utility\\BrowserDrivers\\chromedriver.exe");
ChromeOptions options = new ChromeOptions();
options.addArguments("start-maximized");
options.addArguments("disable-infobars");
options.addArguments("--disable-extensions");
WebDriver driver = new ChromeDriver(options);
driver.navigate().to("https://google.com");
}
}
让我知道这个答案是否是您的问题。
没有为我工作。 “禁用开发者模式扩展”弹出窗口继续出现。 –