1

我已经在我的 linux 服务器上安装了 chromedriver 并且它正在运行

Starting ChromeDriver 2.20.353124 (035346203162d32c80f1dce587c8154a1efa0c3b) on port 9515
Only local connections are allowed.

R 抛出错误:

> startServer(args = c("-port 4444"))
> remDr = remoteDriver(remoteServerAddr = "localhost", port = 4444, browserName = "chrome")
> remDr$open()
[1] "Connecting to remote server"
Error:   Summary: UnknownError
     Detail: An unknown server-side error occurred while processing the command.
     class: org.openqa.selenium.WebDriverException
4

1 回答 1

0

解决方案是使用 DISPLAY 参数手动调用 Selenium 服务器。

command <- "DISPLAY=:1 xvfb-run java -jar /usr/local/lib/R/site-library/RSelenium/bin/selenium-server-standalone.jar &"
system(command, intern = FALSE)
于 2016-01-19T18:10:06.337 回答