ropensci / RSelenium

An R client for Selenium Remote WebDriver

Home Page:https://docs.ropensci.org/RSelenium

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Rselenium is not working properly

covid19ec opened this issue · comments

Hi all. I am using Rselenium and today I got a weird issue. It was working until last friday but now it got crashed. I have updated main packages and also java but it is not working. This is what I get when I use next code:

library(wdman)
library(RSelenium)
library(xml2)
library(selectr)
library(httr)
library(jsonlite)
#start RSelenium
remDr <- rsDriver(
  port = 4445L,
  browser = "firefox"
)
#remDr$open()
remDr <- remoteDriver(port = 4445L,browser = "firefox")

When running the first remDr for rsDriver I got this:

checking Selenium Server versions:
BEGIN: PREDOWNLOAD
BEGIN: DOWNLOAD
BEGIN: POSTDOWNLOAD
checking chromedriver versions:
BEGIN: PREDOWNLOAD
BEGIN: DOWNLOAD
BEGIN: POSTDOWNLOAD
checking geckodriver versions:
BEGIN: PREDOWNLOAD
Error in (function (url, platform, history, appname, platformregex = platform,  : 
  unused argument (fileregex = "\\.(gz|zip)$")

And for the second remDr, it works but trying to use open it fails and shows next message:

remDr$open()
[1] "Connecting to remote server"
Error in checkError(res) : 
  Undefined error in httr call. httr output: Failed to connect to localhost port 4445: Connection refused

How can I solve these issues? This is the session info:

sessionInfo()
R version 4.1.2 (2021-11-01)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19044)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252   
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C                          
[5] LC_TIME=English_United States.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] jsonlite_1.8.4  httr_1.4.4      selectr_0.4-2   xml2_1.3.3      RSelenium_1.7.9
[6] wdman_0.2.6    

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.9       binman_0.1.2     assertthat_0.2.1 rappdirs_0.3.3   bitops_1.0-7    
 [6] R6_2.5.1         semver_0.2.0     magrittr_2.0.3   stringi_1.7.6    curl_4.3.2      
[11] tools_4.1.2      stringr_1.4.0    yaml_2.3.5       compiler_4.1.2   caTools_1.18.2 

following this, as had the same issue...

same on my side, is the first time I see this error, happens with several browsers and I'm using selenium version 1.7.7. Likely has something to do with wdman since it is expecting a jar file (https://github.com/ropensci/wdman/blob/master/inst/yaml/seleniumserver.yml)

Installing a previous version of wdman solves this error (install.packages("https://cran.r-project.org/src/contrib/Archive/wdman/wdman_0.2.0.tar.gz",repos=NULL,type="source")) but another error appears just before connecting.
image

[https://github.com/ropensci/wdman/issues/31#issuecomment-1336651660]

Deleting the LICENSE.chromedriver file fixes this issue for me.

Finding the LICENSE.chromedriver file to delete:

library(wdman)
selenium(retcommand=T)
#delete the LICENSE.chromedriver file

yess!!! it solved the issue for me too, thanks @nbarsch !!

How did you delete the file?

On linux:

sudo rm -rf /myusername/.local/share/binman_chromedriver/linux64/109.0.5414.25/LICENSE.chromedriver

On mac:

sudo rm /Users/myusername/Library/Application Support/binman_chromedriver/mac64/109.0.5414.25/LICENSE.chromedriver

You can find the file location/chromedriverversion which is printed in the output of:

library(wdman)
selenium(retcommand=T)
#delete the LICENSE.chromedriver file

Yes removing the chrome file and changing the wdman version solved the issue many thanks!

Thank you for the help. Worked for me too.

I got this same error with a very similar set up as above, including when running

wdman::selenium(retcommand=T)

I went through and deleted the file indicated (109.0.5414.25/LICENSE.chromedriver) and still continue to get the same error. I'm working on a Mac running on M1 but running RSelenium through Docker. If anyone has any suggestions it would be much appreciated!

In your case, as your are using a Docker container, I assume that your local chromedriver file will not be used by the docker container. Here will be important to check the version of wdman in the docker and what it is calling when launching the selenium driver (docker container filesystem). Could you give more information?

Hi, I'm trying to connect to the server from Windows 10 using R version 4.2.3 and Chrome browser, but I'm getting the same error. I've already tried deleting the LICENSE.chromedriver file but it's not working.
driver <- rsDriver(browser = "chrome")
checking Selenium Server versions:
BEGIN: PREDOWNLOAD
BEGIN: DOWNLOAD
BEGIN: POSTDOWNLOAD
checking chromedriver versions:
BEGIN: PREDOWNLOAD
BEGIN: DOWNLOAD
BEGIN: POSTDOWNLOAD
checking geckodriver versions:
BEGIN: PREDOWNLOAD
BEGIN: DOWNLOAD
BEGIN: POSTDOWNLOAD
checking phantomjs versions:
BEGIN: PREDOWNLOAD
BEGIN: DOWNLOAD
BEGIN: POSTDOWNLOAD
[1] "Connecting to remote server"
Could not open chrome browser.
Client error message:
Undefined error in httr call. httr output: Failed to connect to localhost port 4567 after 2229 ms: Connection refused
Check server log for further details.
Warning message:
In rsDriver(browser = "chrome") : Could not determine server status.