我的操作系统是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‘
并使用以下脚本: require(RSelenium) cprof <- getChromeProfile("C:/Users/Peri/Desktop/chromedriver/chromedriver.exe","Profile 1")
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?
发布于 2017-05-05 22:47:10
您需要使用函数rsDriver。Selenium版本希望你使用Docker (我也会推荐),但是如果你不熟悉它,你可以这样做。
rsdriver将管理运行Selenium Server所需的二进制文件。这为wdman::selenium函数提供了一个包装器。
以下是启动Chrome浏览器必须执行的操作:
driver<- rsDriver()
remDr <- driver[["client"]]然后你就可以使用它了:
remDr$navigate("http://www.google.de")
remDr$navigate("http://www.spiegel.de")并停止它:
remDr$close()https://stackoverflow.com/questions/42810978
复制相似问题