简体   繁体   English

带有 RSDriver 的 RSelenium。 错误:httr output:无法连接到本地主机端口 4445:连接被拒绝

[英]RSelenium with RSDriver. Error: httr output: Failed to connect to localhost port 4445: Connection refused

I am trying to use RSelenium for webscraping.我正在尝试使用RSelenium进行网络抓取。 I am following the basics tutorial as explained on cran .我正在按照cran上解释的基础教程进行操作。 The recommended approach is to install Docker (see tutorial as well as this stackoverflow answer).推荐的方法是安装 Docker(请参阅教程以及这个stackoverflow 答案)。 If I understand correctly, this is not an option for me as I am operating on Windows 7 for which Docker seems not to be available (see docker forum ).如果我理解正确,这不是我的选择,因为我在 Windows 7 上运行, Docker似乎不可用(请参阅docker 论坛)。

Thus, I am trying option 2 using the RSDriver.因此,我正在尝试使用 RSDriver 的选项 2。 I run我跑

RSelenium::rsDriver()

remDr <- remoteDriver(
  remoteServerAddr = "localhost",
  port = 4445L,
  browserName = "firefox"
)
    
remDr$open()

and get the error并得到错误

> remDr$open()
[1] "Connecting to remote server"
Error in checkError(res) : 
  Undefined error in httr call. httr output: Failed to connect to localhost port 4445: Connection refused

This question has been asked and answered before here , here , here and here , though these are about the same error when using Docker and their solutions did not work for me.这个问题在herehereherehere之前已经被问过和回答过,尽管在使用 Docker 时这些都是关于相同的错误,并且他们的解决方案对我不起作用。

Is there anyway to get this running with rsDriver ?有没有办法让这个与rsDriver一起运行? Is there any option for me as a Windows 7 user?作为 Windows 7 用户,我有什么选择吗?

With RSelenium version 1.7.7 this is a workaround:对于RSelenium 1.7.7 版,这是一种解决方法:

library(RSelenium)

remDr <- rsDriver(
  port = 4445L,
  browser = "firefox"
)

This command combines the server setup, and driver initation.此命令结合了服务器设置和驱动程序启动。

My issue (on Mac) was updating Java:我的问题(在 Mac 上)正在更新 Java:

https://www.oracle.com/java/technologies/downloads/#jdk19-mac https://www.oracle.com/java/technologies/downloads/#jdk19-mac

Worked after this.在此之后工作。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 checkError(res) 中的错误:httr 调用中的未定义错误。 httr 输出:无法连接到本地主机端口 4445:连接被拒绝 - Error in checkError(res) : Undefined error in httr call. httr output: Failed to connect to localhost port 4445: Connection refused Rselenium - 端口 4445:连接被拒绝 - Rselenium - port 4445: Connection refused 如何解决RSelenium错误消息“无法连接到本地主机端口4444:连接被拒绝”? - How to resolve RSelenium error message “Failed to connect to localhost port 4444: Connection refused”? Elasticsearch错误:无法连接到本地主机端口9200:连接被拒绝 - Elasticsearch error: Failed to connect to localhost port 9200: Connection refused Docker:无法连接到 localhost 端口 80:连接被拒绝 - Docker: Failed to connect to localhost port 80: Connection refused Docker curl:(7)无法连接到本地主机端口80:连接被拒绝 - Docker curl: (7) Failed to connect to localhost port 80: Connection refused Docker:curl:(7)无法连接到localhost端口9089:连接被拒绝 - Docker: curl: (7) Failed to connect to localhost port 9089: Connection refused curl: (7) 无法连接到本地主机端口 10001:连接被拒绝 DOCKER - curl: (7) Failed to connect to localhost port 10001: Connection refused DOCKER curl:(7)无法连接到localhost端口8090:连接被拒绝 - curl: (7) Failed to connect to localhost port 8090: Connection refused Docker - 无法连接到localhost端口4000:连接被拒绝 - Docker - Failed to connect to localhost port 4000: Connection refused
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM