[英]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.这个问题在here 、 here 、 here和here之前已经被问过和回答过,尽管在使用 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.