您正处在正确的轨道上。综观?remoteDriver
的click
方法描述为:
click(buttonId = 0) Click any mouse button (at the coordinates set by the last mouseMoveToLocation() command). buttonId - any one of 'LEFT'/0 'MIDDLE'/1 'RIGHT'/2. Defaults to 'LEFT'
此方法是点击屏幕上的位置。您的代码可以稍微更改,以便分配findElement
方法结果。
library(RSelenium)
# startServer() # start Selenium Server if needed
remDr <- remoteDriver()
remDr$open(silent = TRUE)
remDr$navigate("http://www.nngroup.com/articles/checkboxes-vs-radio-buttons/")
webElem <- remDr$findElement("id", "three")
> class(webElem)
[1] "webElement"
attr(,"package")
[1] "RSelenium"
看着为webElement
类的文档有一个方法clickElement
:
webElem$clickElement()
使用这种方法应该产生所需要的结果。
非常感谢!这工作。 – kennyB 2014-11-04 03:47:02
乐意帮忙... – jdharrison 2014-11-04 03:49:03