Home > other >  RSelenium not working anymore on macOS with error Undefined error in httr call
RSelenium not working anymore on macOS with error Undefined error in httr call

Time:10-03

I try to run a selenium server, connected to a firefox in MacOS. This had worked until I updated Java. I dont know what to do, and I cant use Docker cause I need to download some outputs from the website Im trying to scrape.

This is the verbose of the error:

rs_driver_object=rsDriver(browser="firefox", port=4410L, verbose=TRUE)
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 firefox browser.
Client error message:
Undefined error in httr call. httr output: Failed to connect to localhost port 4410 after 0 ms: Connection refused
Check server log for further details.
Warning message:
In rsDriver(browser = "firefox", port = 4410L, verbose = TRUE) :

CodePudding user response:

I have encountered this error myself before, and most likely this is caused by using the same port number during multiple attempts. Every time, the port number must be changed.

Also, if that fails, I highly recommend using the wdman package to manage your RSelenium server.

See my post here for an example usage of wdman:

How to get a table from power BI dashboard using web scraping in R

  • Related