我很难做我想做的是:从Steam评论中获取所有数据。我目前正在视频游戏的前期制作中,我想对用户在游戏玩法方面对我们很接近的游戏的评论进行一些文本挖掘。
我正在使用Rvest。
2个问题: -我无法设法将评论与发布日期区分开。我想把它们放在分开的柱子中。我该怎么办? -效果很好,但是...我的data.frame中只有10条评论,如何获得所有评论? (我花了几个小时来尝试了解我该怎么做,但似乎不可能,因为,如果我正确理解,每次我们进入网站底部时,steam都会使用javascript注入,而rvest不会这样做读取链接。
这是我的代码:
#install.packages("rvest")
library(rvest)
link <- "https://steamcommunity.com/app/215080/reviews/"
review <- read_html(link) %>%
html_nodes("div.apphub_CardTextContent") %>%
html_text()
opinion <- read_html(link) %>%
html_nodes("div.title") %>%
html_text()
hoursplayed <- read_html(link) %>%
html_nodes("div.hours") %>%
html_text()
helpful <- read_html(link) %>%
html_nodes("div.found_helpful") %>%
html_text()
date <- read_html(link) %>%
html_nodes("div.date_posted") %>%
html_text()
tab <- data.frame("Posted" = date,"Review" = review,"Opinion" = opinion,"Hours Played" = hoursplayed,"Number of helpful vote" = helpful)
预先感谢您的帮助。