ropensci / RSelenium

An R client for Selenium Remote WebDriver
https://docs.ropensci.org/RSelenium
341 stars 81 forks source link

rsDriver() issue #266

Closed chriscarrollsmith closed 1 year ago

chriscarrollsmith commented 1 year ago

Recently, the rsDriver() function started throwing an error every time I tried to open it:

[1] "Connecting to remote server" Error in checkError(res) : Undefined error in httr call. httr output: Failed to connect to localhost port 4567: Connection refused In addition: Warning message: In rsDriver() : Could not determine server status.

I'm not the only one who had this issue. A StackOverflow user posted a workaround here: https://stackoverflow.com/a/74735571/14831364

Adding "iedrver = NULL" fixes the problem. The StackOverflow user explains, "rsDriver() is default configured to launch the Selenium server with the latest versions of both Chrome and Firefox (Gecko) drivers, even if you have specified the other browser to run. In my case, I was specifying browser = "firefox", but a new Chrome driver had auto-downloaded on the most recent run and, for whatever reason, wasn't playing nice with Selenium. That was the root cause of the issue."

chriscarrollsmith commented 1 year ago

On second thought, this fix worked for me once, but now I can't reproduce it and am continuing to get the same error message.

alberto-martin commented 1 year ago

Just to say that I encountered the same issue this week, in two different machines.

chriscarrollsmith commented 1 year ago

Thanks. Nice to know I'm not crazy. :)

chriscarrollsmith commented 1 year ago

Others apparently solved this issue by rolling back wdman from version 0.2.6 to 0.2.5:

remove.packages("wdman") install.packages("remotes") library(remotes) install_version("wdman", "0.2.6")

I was actually able to get it working with version 0.2.6 by updating all of the packages that wdman is dependent upon. It appears that I had some pretty old versions of packages like yaml and jsonlite that hadn't been updated in a long time. Once I updated all of these, rsDriver started working again.

tpcovino commented 1 year ago

I am continuously getting "Undefined error in httr call. httr output: Failed to connect to localhost port 14415 after 0 ms: Connection refused". I've tried every work around I've found on the internet. Has anyone found a definitive solution to this issue?

dfe-nt commented 1 year ago

I'm also getting this issue and none of the work arounds suggested here or that I have found on stack overflow have worked for me. This occurred on a new machine so all packages installed are up to date. It occurs with both the chrome and firefox browsers, although not with phantomjs.

Very keen to find a solution to this as I'm somewhat dependant on being able to load javascript generated content.

jcutlerbiostats commented 1 year ago

I would love to find a solution as well. I've tried the solutions on stackoverflow and nothing works.

rkahne commented 1 year ago

Try this: rD <- rsDriver(browser="firefox", port=4555L, verbose=F, chromever = NULL)

The issue appears to be with the chrome driver for me, and running a firefox browser and setting the chrome driver to null allowed me to start the server.

jcutlerbiostats commented 1 year ago

Yep that worked! I actually tried Firefox yesterday, as it happens. I've given up on Chrome. Firefox worked immediately with no additional fuss.

Thanks!

abuhamour commented 1 year ago

This worked for me as well, thanks very much @rkahne !!

ZHANGZ1YUE commented 1 year ago

For anyone who tried every solutions (including the above one) but still couldn't make it work, try to see if JAVA is installed properly.

mahe3396 commented 1 month ago

Running a firefox browser and setting the chrome driver to null worked for me