繁体   English   中英

硒问题

[英]Rselenium issue

我正在尝试使用Rselenium抓取一个网站。 但是我遇到一个错误:

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.

我的chrome已更新为58版本,moxilla已更新为45版本,rselenium以前可以工作,但是我不确定发生了什么,请帮助大家。

以下脚本适用于新的RSelenium ...

rD <- rsDriver(port=4444L,browser="chrome")
remDr <- rD$client
remDr$navigate(url)

只需确保您具有docker帐户并安装它即可。

尝试这个

library('RSelenium')
rD=rsDriver()
remDr =rD[["client"]]
remDr$navigate("https://www.vinmonopolet.no/vmp/Land/Chile/Gato-Negro-Cabernet-Sauvignon-2017/p/295301")
webElement = remDr$findElement('xpath', '//*[@id="product_2953010"]/span[2]')
webElement$clickElement()

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM