我想从这个网页上删除所有评论: https://www.airbnb.com/rooms/10597708
我的代码:
library('RSelenium')
library('XML')
library('RCurl')
pJS <- phantom()
shell.exec(paste0("C:\\Users\\Daniil\\Desktop\\R-language,Python\\file.bat"))
Sys.sleep(10)
checkForServer()
startServer()
remDr <- remoteDriver(browserName="chrome", port=4444)
remDr$open(silent=T)
Reviews <- remDr$findElement(using = 'id',value = 'reviews')
elem <- Reviews$getElementAttribute("outerHTML")[[1]]
elemxml <- htmlTreeParse(elem, useInternalNodes=T)
e <- xpathApply(elemxml, "//*[(@class = 'row review')]", xmlValue)
但它只返回7条可见的评论。如何提取所有评论? 一般而言,在这种情况下我应该做什么(当只有零件信息可见时)