RSelenium与Docker。 checkError(res)出错

问题描述 投票:2回答:1

在线使用RSelenium和Docker的文档后,我安装了Docker Toolbox和RSelenium。

在Docker Toolbox中,我运行

$ docker run -d -p 4445:4445 selenium/standalone-chrome

$ docker ps,

并获得以下输出。

enter image description here

然后,我在R中运行以下命令:

library(RSelenium)
library(Rvest) #not sure if I need this?
#192.168.99.100 is my IP

remDr <- RSelenium::remoteDriver(remoteServerAddr = "192.168.99.100", 
                             port = 4445L)
remDr$open()

但我得到了错误

Error in checkError(res) : 
  Undefined error in httr call. httr output: Failed to connect to 
192.168.99.100 port 4445: Connection refused

在Kitematic中,我看到了这个:

enter image description here

我能想到的唯一一件事是,我没有正确使用Toolbox(需要Docker for Windows),或者remoteDriver()的path参数中的默认路径不正确。

我在Windows机器上运行,但没有Windows 10专业版。

有人有任何想法吗?

r selenium docker selenium-webdriver rselenium
1个回答
1
投票

selenium / standalone-chrome收听4444端口。这就是你应该映射yo 4444端口的原因。

docker run -d -p 4445:4444 selenium/standalone-chrome一样跑

© www.soinside.com 2019 - 2024. All rights reserved.