r-RSelenium不再在macOS上工作,出现错误httr调用中的未定义错误



我尝试运行一个硒服务器,连接到MacOS中的firefox。这在我更新Java之前一直有效。我不知道该怎么办,我不能使用Docker,因为我需要从我试图抓取的网站上下载一些输出。

这是详细的错误:

rs_driver_object=rsDriver(browser="firefox", port=4410L, verbose=TRUE)
checking Selenium Server versions:
BEGIN: PREDOWNLOAD
BEGIN: DOWNLOAD
BEGIN: POSTDOWNLOAD
checking chromedriver versions:
BEGIN: PREDOWNLOAD
BEGIN: DOWNLOAD
BEGIN: POSTDOWNLOAD
checking geckodriver versions:
BEGIN: PREDOWNLOAD
BEGIN: DOWNLOAD
BEGIN: POSTDOWNLOAD
checking phantomjs versions:
BEGIN: PREDOWNLOAD
BEGIN: DOWNLOAD
BEGIN: POSTDOWNLOAD
[1] "Connecting to remote server"
Could not open firefox browser.
Client error message:
Undefined error in httr call. httr output: Failed to connect to localhost port 4410 after 0 ms: Connection refused
Check server log for further details.
Warning message:
In rsDriver(browser = "firefox", port = 4410L, verbose = TRUE) :

我以前也遇到过这个错误,很可能是由于多次尝试使用相同的端口号造成的。每次都必须更改端口号。

此外,如果失败,我强烈建议使用wdman软件包来管理RSelenium服务器。

关于wdman:的示例用法,请参阅我的文章

如何在R 中使用web抓取从power BI仪表板获取表格

这可能是wdman的一个错误。

你能运行吗

library(wdman)
selenium(retcommand = T)

并发送输出?我遇到了类似的问题,并且能够解决https://github.com/ropensci/wdman/issues/31

最新更新