Google Play网络抓取:如何在R中识别对应用评论的反应?

我正在用R抓取Google Play应用程序的评论进行Web抓取,但是我无法确定对评论的回应不足。

我解释。我打算建立一个包含两列的数据库。一个带有评论文字,另一列带有应用对该评论的回复。在最后一列中,如果没有响应,它将具有空值。但是,我只能得到答案,而无法确定没有答案。该怎么办?

输入

Google Play网络抓取:如何在R中识别对应用评论的反应?

输出 我想退回的物品

Google Play网络抓取:如何在R中识别对应用评论的反应?

我如何得到这个?确定没有响应

完整代码

#Loading the rvest package
library(rvest)
library(magrittr) # for the '%>%' pipe symbols
library(RSelenium) # to get the loaded html of 


url <- 'https://play.google.com/store/apps/details?id=com.gospace.parenteral&showAllReviews=true'

# starting local RSelenium (this is the only way to start RSelenium that is working for me atm)
selCommand <- wdman::selenium(jvmargs = c("-Dwebdriver.chrome.verboseLogging=true"),retcommand = TRUE)
shell(selCommand,wait = FALSE,minimized = TRUE)
remDr <- remoteDriver(port = 4567L,browserName = "firefox")
remDr$open()

# go to website
remDr$navigate(url)


# get page source and save it as an html object with rvest
html_obj <- remDr$getPageSource(header = TRUE)[[1]] %>% read_html()

#1 column
reviews <- html_obj %>% html_nodes(".UD7Dzf") %>% html_text()

#2 column
reply <- html_obj %>% html_nodes('.LVQB0b') %>% html_text()


# create the df with all the info
review_data <- data.frame(reviews = reviews,reply = reply,stringsAsFactors = F)
nana0124 回答:Google Play网络抓取:如何在R中识别对应用评论的反应?

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3143141.html

大家都在问