操作系统是windows10,编程语言是JAVA,浏览器是IE11。没有浏览器窗口,selenium如何运行?
发布于 2017-09-27 10:15:45
您可以使用幻影、HtmlUnitDriver或无头铬。
对于HtmlUnitDriver
WebDriver driver=new HtmlUnitDriver();
driver.get("http://google.com"); 第一次下载幽灵驱动程序并使用
System.setProperty("phantomjs.binary.path", "E:\\phantomjs-2.1.1-windows\\phantomjs.exe");
WebDriver driver = new PhantomJSDriver();
driver.get("http://google.com"); 对于chrome下载Chromedriver并使用
System.setProperty("webdriver.chrome.driver","E:/software and tools/chromedriver_win32/chromedriver.exe");
ChromeOptions chromeOptions = new ChromeOptions();
chromeOptions.addArguments("headless");
driver.get("http://google.com"); 发布于 2016-08-29 08:55:00
使用一个无头浏览器,比如幻影Use,htmlunit来运行selenium。
https://stackoverflow.com/questions/39201611
复制相似问题