根据在Docker中使用RSelenium的在线文档,我已经安装了Docker工具箱和RSelenium。
在Docker工具箱中,我运行
$ docker run -d -p 4445:4445 selenium/standalone-chrome
和
$ docker ps,
并获得以下输出。
然后,我在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
在基特马,我看到了这个:
我能想到的唯一原因是我没有正确使用工具箱(需要Docker for Windows代替),或者remoteDriver()的path参数中的默认路径不正确。
我在Windows机器上运行,但没有Windows 10专业版。
有谁有什么想法吗?
发布于 2019-02-21 17:26:37
selenium/standalone-chrome监听4444端口。这就是为什么你应该映射YO4444端口。
以docker run -d -p 4445:4444 selenium/standalone-chrome
用户身份运行
https://stackoverflow.com/questions/54785786
复制相似问题