r语言 - RSelenium on rstudio Server; Firefox



我想使用RSelenium进行网页抓取,但是在尝试连接到Firefox时遇到了这个问题。如有任何帮助,不胜感激。

> rD <- rsDriver(browser = "firefox")
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"

Selenium message:Expected browser binary location, but unable to find binary in default location, no 'moz:firefoxOptions.binary' capability provided, and no binary flag set on the command line
Build info: version: '4.0.0-alpha-2', revision: 'f148142cf8', time: '2019-07-01T21:30:10'
System info: host: 'L90801', ip: '10.146.202.24', os.name: 'Windows 10', os.arch: 'x86', os.version: '10.0', java.version: '1.8.0_162'
Driver info: driver.version: unknown
remote stacktrace: 

Could not open firefox browser.
Client error message:
Summary: SessionNotCreatedException
Detail: A new session could not be created.
Further Details: run errorDetails method
Check server log for further details.

这段代码对我来说很好,记住,你需要安装java并设置哪一个是你的chromeover

在错误信息中显示哪些是您可用的

rd <- rsDriver(port = 4445L,browser = "chrome", chromever = "95.0.4638.54")
rem <- rd$client
rem$open()

最新更新