I am using a selenium/standalone-firefox docker container that I have installed R into. The aim is to set up a daily scrape of a webpage using GCS. I have an R selenium script that runs well locally. However when I try and run it in the container I cannot connect to the selenium server. I have checked the seleneium server is running and firefox is available.
I have been using this code to try and make the connection using R inside the container:
remDr <- remoteDriver(
remoteServerAddr = "localhost",
port = 4444L,
browserName = "firefox",
version = "latest")
remDr$open()
And this is the output:
[1] "Connecting to remote server"
$id
[1] NA
I have tried various other options I found on the internet but none have worked. I've also tried using a headless option with no success. When I run the script locally I have been using :
rD <- rsDriver(browser = "firefox", port = 4444L, verbose = TRUE, chromever = NULL, extraCapabilities = capabilities)
remDr <- rD[["client"]]!
Which works fine locally but not within the container. I think because the server is already running.
Can anyone help? I've been going around in circles for ages on this!
Thanks