1

I have been using Rselenium for a webscraping program I run everyday for the past year. On 12/2 it suddenly stopped working. I have not made any updates to R or the packages it uses, nor any changes to the code. I am not using Docker but I ran it both my local machine and on my EC2 instance and it worked on neither. Code and errors I below, but any help into possible solutions is appreciated

library(shiny)
library(rvest)
library(RSelenium)
library(Rfast)
library(stringr)
library(rebus)
portnumber <- sample(4000:5000,1, replace = TRUE)
portnumber <- as.integer(portnumber)
rD <- rsDriver(remoteServerAddr = "localhost", browser="firefox", port=portnumber, verbose=F)

Error when ran on local machine

Error when ran in EC2

I have tried running on different ports which got the same error. I have tried running it on different machines which produced different errors. I have tried typing in the address instead of "localhost" which didn't work.

r2evans
  • 141,215
  • 6
  • 77
  • 149
Aegon1776
  • 11
  • 2
  • 2
    Does choosing another browser emulation (e. g. "chrome" instead of "firefox") help? https://www.rdocumentation.org/packages/RSelenium/versions/1.7.9/topics/rsDriver – I_O Dec 08 '22 at 00:34
  • Please do not show code/output as image, but copy it as text. There are blind users of this site, and screen readers do not work with images – kjetil b halvorsen Dec 08 '22 at 01:53
  • See my answer here https://stackoverflow.com/questions/74708282/rselenium-is-not-working-when-creating-servers/74741164?noredirect=1#comment131922378_74741164 since the stupid moderators won't let me post an identical answer even though it answers your question – Neal Barsch Dec 10 '22 at 08:01

1 Answers1

0

You can consider using docker with firefox as follows :

library(RSelenium)
library(rvest)
shell('docker run -d -p 4446:4444 selenium/standalone-firefox')
remDr <- remoteDriver(remoteServerAddr = "localhost", port = 4446L, browserName = "firefox")
remDr$open()
remDr$navigate(url)
Emmanuel Hamel
  • 1,769
  • 7
  • 19