【发布时间】:2018-06-15 18:09:02
【问题描述】:
我已经安装了 RSelenium(软件包),以便从 hockeyreference.com 上抓取一些 NHL 统计数据
它工作正常,一切正常,但最近停止工作,出现此错误:
[1] "Connecting to remote server"
Could not open chrome browser.
Client error message:
Undefined error in httr call. httr output: Failed to connect to
localhost port 4567: Connection refused
Check server log for further details.
$client
[1] "No sessionInfo. Client browser is mostly likely not opened."
$server
Process Handle
command : /private/var/folders/dk/kf4tf83n1lg40687w6fmq5wh0000gn/T/Rtmpiy1cOY/file1d1856ef53ae.sh
system id : 18786
state : exited
Warning message:
In rsDriver(port = 4567L, geckover = NULL, phantomver = NULL) :
Could not determine server status.
我尝试重新安装,但无法正常工作。这个问题概述了我的原始安装(使用自制软件,安装了最新的 chromedriver):
Css selector issue with rvest and NHL statistics
任何帮助都会很棒。我使用 RSelenium 运行的代码在这里:
https://github.com/papelr/nhldatar/blob/master/nhldatar/R/nhldatar-phase-2.R
TL;DR,我无法让 rsDriver 参数工作,它给出了上面发布的错误:
rsDriver(port = 4567L, geckover = NULL, phantomver = NULL)
remDr <- remoteDriver(browserName = "chrome")
remDr$open()
如果 RSelenium 可以正常工作(打开 chrome 浏览器),那么剩下的就可以运行了!谢谢!
【问题讨论】:
-
包作者建议通过docker运行RSelenium:rpubs.com/johndharrison/RSelenium-Docker
-
我认为这仅适用于 Windows/Linux @Mislav
-
我看不出为什么你不能在 mac 上这样做。我刚刚找到了这个链接,例如:raynergobran.com/2017/01/rselenium-mac-update
标签: r macos selenium rselenium