我有以下代碼:ChromeDriver需要安裝Chrome嗎?
ChromeOptions chromeOptions = new ChromeOptions();
chromeOptions.addArguments("--headless");
webDriver = new ChromeDriver(chromeOptions);
它拋出該異常:
Gtk-Message: Failed to load module "topmenu-gtk-module"
Created new window in existing browser session.
Exception in thread "main" org.openqa.selenium.WebDriverException:
Timed out waiting for driver server to start.
Build info: version: '3.4.0', revision: 'unknown', time: 'unknown'
System info: host: 'luis', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '4.4.0-87-generic', java.version: '1.8.0_112'
Driver info: driver.version: ChromeDriver
at org.openqa.selenium.remote.service.DriverService.waitUntilAvailable(DriverService.java:193)
at org.openqa.selenium.remote.service.DriverService.start(DriverService.java:181)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:78)
我是新來這個,我失去的東西嗎?應該運行在我的主機上的其他服務器?
什麼是你的Chrome版本和操作系統?你可以打的Chrome://版本「 –
是的,它表明: 谷歌瀏覽器\t 55.0.2883.75(正式版本)(64位) 修訂\t 451c239c3b0722dc867b0f75839b959f729b756a-裁判/分支頭/ 2883 @ {#698} OS \t Linux的 的JavaScript V8 \t 5.5.372.29 閃存\t 26.0.0.137 用戶代理\t的Mozilla/5.0(X11;的Linux x86_64的)爲AppleWebKit/537.36(KHTML,例如Gecko)Chrome瀏覽器/ Safari瀏覽器55.0.2883.75/537.36 命令行\t/usr/bin/google-chrome-stable --flag-switches-begin --enable-devtools-experiments --flag-switch-end 可執行文件路徑\t/opt/google/chrome/google-chrome – italktothewind
你可以將它更新到chrome 59並檢查相同的代碼\? –