我正在使用Selenium Chrome驱动程序并希望禁用日志记录,我尝试了所有现有解决方案,包括:
ChromeOptions chromeOptions = new ChromeOptions();
chromeOptions.addArguments("--log-level=3");
Run Code Online (Sandbox Code Playgroud)
和
DesiredCapabilities capabilities = DesiredCapabilities.chrome();
capabilities.setCapability("chrome.verbose", false);
Run Code Online (Sandbox Code Playgroud)
但没有一个对我有用,仍然显示此信息和警告日志:
在端口17965上启动ChromeDriver 2.25.426924(649f9b868f6783ec9de71c123212b908bf3b232e)仅允许本地连接.2017年7月25日下午7:01:16 org.openqa.selenium.remote.ProtocolHandshake createSession INFO:尝试双方言会议,假设Postel法则在远程结束时于2017年7月25日下午7:01:16 org.openqa .selenium.remote.ProtocolHandshake createSession INFO:检测到的方言:OSS