2
我在Rselenium是新Rselenium的问题,我一直在努力刮网页用下面的代码:找到一个元素
library(reshape)
library(plyr)
library(RSelenium)
#start RSelenium
checkForServer()
startServer()
remDr <- remoteDriver()
remDr$open()
remDr$navigate(paste0("http://www.metrocuadrado.com/web/apartamentos/venta/c:bogota"))
我要选择的区域类别(面积m2 :),我不“T有选择其中大部分(例如)任何问题:
remDr$findElement(using = "xpath", paste0("//select[@name = 'arearango']/option[@value = 'Hasta 60']"))$clickElement()
但随着最后一类:
checkForServer()
startServer()
remDr <- remoteDriver()
remDr$open()
remDr$navigate(paste0("http://www.metrocuadrado.com/web/apartamentos/venta/c:bogota"))
remDr$findElement(using = "xpath", paste0("//select[@name = 'arearango']/option[@value = '1001 o más']"))$clickElement()
我有一个错误:
Error: Summary: NoSuchElement
Detail: An element could not be located on the page using the given search parameters.
class: org.openqa.selenium.NoSuchElementException
我想,这个问题有口音要做,但我一直没能解决这个问题,我该怎么选择这个元素?