最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Using R Selenium inside a seleniumstandalone-firefox Docker container. Connecting to the server - Stack Overflow

programmeradmin2浏览0评论

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

发布评论

评论列表(0)

  1. 暂无评论