如何打开谷歌浏览器与RSelenium? [英] How to open Google Chrome with RSelenium?

查看:955
本文介绍了如何打开谷歌浏览器与RSelenium?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用RSelenium,我想浏览的Chrome。不过,我总是得到一个错误。下面code被使用。

I am using RSelenium and I want to navigate Chrome. However, I always get an error. The following code is used.

library("RSelenium")
startServer()
mybrowser <- remoteDriver(browserName = "chrome")
mybrowser$open()

[1] "Connecting to remote server"
Error:   Summary: UnknownError
 Detail: An unknown server-side error occurred while processing the command.
 class: java.lang.IllegalStateException

我怎么能resovle这个问题?

How can I resovle this issue?

推荐答案

即使安装谷歌Chrome,还有一些人失踪是由硒需要。这是chromedriver。 chromedriver可以在这个网站上下载 。目前,最新的版本是2.9。例如,如果一个人使用Windows,文件chromedriver_win32.zip需要被下载。

Even though Google Chrome is installed, there is still something missing that is needed by Selenium. This is the "chromedriver". "chromedriver" can be downloaded on this website. Currently, the most recent version is 2.9. For instance, if one is using Windows, the file "chromedriver_win32.zip" needs to be downloaded.

当文件被下载,解压缩文件在里面,即chromedriver.exe。将你希望它是chromedriver.exe。我把它放在用户/文档/ R。

When the file is downloaded, extract the file in it, i.e. "chromedriver.exe". Place "chromedriver.exe" where you want it to be. I put it in "User/Documents/R".

在最后一个步骤中,需要添加其中chromedriver.exe位于到系统路径的文件夹。一种用于文件夹添加到系统路径的描述,可以发现的这里

In the last step, you need to add the folder where "chromedriver.exe" is located to the system path. A description for adding a folder to the system path can be found here.

现在,我们可以重新开始的研究的并运行code。

Now, one can restart R and run the code.

这篇关于如何打开谷歌浏览器与RSelenium?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆