【发布时间】:2017-08-06 06:19:56
【问题描述】:
我的操作系统是 windows 8.1,我的版本是 R.3.3.3。
我已经安装了 RSelenium 包并尝试使用它来运行它:
library("RSelenium")
#start RSelenium server
startServer()
checkForServer()
我收到此错误:
Error: checkForServer 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.
RSelenium 打开的方式有什么变化吗?我搜索错误,我只找到this,但这对我没有帮助。我能做什么?
我尝试过的另一种方法是从这里下载 chromedrive 'https://sites.google.com/a/chromium.org/chromedriver/downloads'
并使用此脚本: 需要(RS硒) cprof
require(RSelenium)
remDr <- remoteDriver(remoteServerAddr = "localhost"
, port = 4444
, browserName = "chrome", extraCapabilities = cprof
)
remDr$open()
我收到此错误:
Error in checkError(res) :
Couldnt connect to host on http://localhost:4444/wd/hub.
Please ensure a Selenium server is running.
如何运行 chrome 而不是默认浏览器 Firefox?
【问题讨论】:
-
你尝试过小插图rpubs.com/johndharrison/RSelenium-Basics 。它在附录中概述了使用 Docker 和 rsDriver。
-
@jdharrison 我从 cmd 尝试了 selenium 的独立版本,然后运行 RSelenium,我可以打开 chrome 但我可以给出一个简单的
remDr$navigate("www.google.com") -
关注基本的小插图 rpubs.com/johndharrison/RSelenium-Basics 和 docker rpubs.com/johndharrison/RSelenium-Docker 。您需要完整的 html 路径
remDr$navigate("http://www.google.com")