0
我正在學習網絡抓取並試圖從https://www.kununu.com/us/google1/reviews中刮取信息。在頁面末尾存在「加載更多」選項時使用rvest刮擦數據
這裏是我的代碼:RM(名單= LS())
library(httr)
library(rvest)
library(xml2)
library(curl)
url <- "https://www.kununu.com/us/google1/reviews"
reviews <- url %>%
read_html() %>%
html_nodes(".panel-body")
quote <- reviews %>%
html_nodes("h2 a") %>%
html_text()
rating <- reviews %>%
html_nodes(".tile-heading") %>%
html_text()
date <- reviews %>%
html_nodes("strong") %>%
html_text()
a <- data.frame(quote, rating, date, stringsAsFactors = FALSE)
然而,上面的代碼擦傷只有大約10個團體。我在網上找到了關於動態網站的RSelenium包的一些建議。不幸的是,當我使用checkForServer()時,我的計算機會拋出錯誤,然後是startServer()命令。當LOAD MORE選項位於底部時,有任何想法可以一次性刪除所有56條評論?
感謝科裏,我會盡力的。 –