RSelenium UnknownError - java.lang.IllegalStateException with Google Chrome

前端 未结 2 1942
心在旅途
心在旅途 2020-12-10 00:20

I am running the following script based on the RSelenium Basics CRAN page:

library(RSelenium)
startServer(args = c(\"-port 4455\"), log = FALSE, invisible =          


        
2条回答
  •  既然无缘
    2020-12-10 00:47

    It is worth noting that RSelenium has some annoying differences for OSX. The invisible=T/silent=T arguments will not work when you run the yourcommand.command file and the remDr$open() method, respectively. The invisible=T will actually remind you that it only works on Windows. Not a huge deal (and if someone has a workaround I'd appreciate it).

    For posterity's sake here's a slight variation for OSX to replace shell.exec using a .command file instead of a .bat with the same contents as above:

    yourcommand.command file contents

    java -jar /path/to/selenium-server-standalone.jar -Dwebdriver.chrome.driver=/path/to/chromedriver
    

    R script modification

    library(RSelenium)
    system(paste("open","/path/to/yourcommand.command"))
    Sys.sleep(5)
    ...
    

提交回复
热议问题