我正试图抓下一页:
https://www.dukascopy.com/swiss/english/marketwatch/sentiment/
具体而言,' span'中的数字。标签,绿色和红色条中的百分比。我正在使用rselenium,我的代码如下:
checkForServer()
startServer()
remDr<-remoteDriver$new()
remDr$open(silent = TRUE) #opens a browser
remDr$navigate("https://www.dukascopy.com/swiss/english/marketwatch/sentiment/")
webElems <- remDr$findElements(using = 'css selector', "span")
#pretvorim v tekst
resHeaders <- unlist(lapply(webElems, function(x){x$getElementText()}))
直到最后一行,我收到错误:
元素命令失败,因为引用的元素不再附加到DOM
出了什么问题?