首页 > 解决方案 > Rselenium 指定 chrome 驱动的目录

问题描述

我正在尝试运行 Rselenium,但该软件包无法找到我的chromedriver.exe.

我的工作目录是我的Documents文件夹,我chromedriver.exe在文件夹中。但它仍然无法找到它。它一直在一个临时文件夹中查找。

> library(RSelenium)
> driver<- rsDriver()
checking Selenium Server versions:
BEGIN: PREDOWNLOAD
BEGIN: DOWNLOAD
BEGIN: POSTDOWNLOAD
Error in `[[<-`(`*tmp*`, platvec, value = switch(Sys.info()["sysname"],  : 
  no such index at level 1

所以然后我用

startServer(args = c("-Dwebdriver.chrome.driver=C:/Users/Jessica/Documents/chromedriver.exe")) 

Error: startServer is now defunct. Users in future can find the function in
    file.path(find.package("RSelenium"), "examples/serverUtils"). The
    recommended way to run a selenium server is via Docker. Alternatively
    see the RSelenium::rsDriver function.

但有一个弃用错误。显然该功能不再起作用。

如何指定 的位置chromedriver.exe?该函数rsDriver()没有任何选项可以将其放置在那里。

标签: rrselenium

解决方案


推荐阅读