gpt4 book ai didi

r - RSelenium与Docker。 checkError(res)中的错误

转载 作者:行者123 更新时间:2023-12-02 18:28:37 24 4
gpt4 key购买 nike

在在线阅读有关将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

我能想到的唯一原因是,我没有正确使用工具箱(而是需要Windows的Docker),或者remoteDriver()的path参数中的默认路径不正确。

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

有人有什么想法吗?

最佳答案

selenium / standalone-chrome侦听4444端口。这就是为什么您应该映射4444端口。

作为docker run -d -p 4445:4444 selenium/standalone-chrome运行

关于r - RSelenium与Docker。 checkError(res)中的错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54785786/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com