如何在R中使用RSelenium按下按钮。网页抓取

时间:2019-12-17 10:43:58

标签: android r web-scraping

我正在尝试抓取Google Play上的所有应用评论。问题在于,加载评论页面向下滚动4次后,会出现“显示更多”按钮,但是我不知道如何按下它并再次运行4次,依此类推,直到到达页面底部为止。

#scroll down 10 times, waiting for the page to load at each time
for(i in 1:10){      
remDr$executeScript(paste("scroll(0,",i*10000,");"))
Sys.sleep(4)    
}

我的“向下滚动”代码如下。他把它加载了10次,但没有用,因为向下滚动4次后,出现“显示更多”按钮,而且我不知道如何在代码中按下它。

你能帮我吗?

enter image description here

0 个答案:

没有答案