我正在尝试在 goodreads 上抓取评分和评论数字,但得到的是 NA 结果。为什么是这样?
SelectorGadget 为悬停时的平均评分找到“跨度跨度”,但在底部没有找到“有效路径”。
在其他网站(例如 IMDB、theatlantic.com)上使用相同的方法效果很好。
这是我的代码和结果(我也尝试用 html_tag 替换 html_text)
Rating<- html("http://www.goodreads.com/book/show/22444789-delicious-foods")
Rating %>%
html_node("span span") %>%
html_text () %>%
as.numeric()
[1] NA
Warning message:
In function_list[[k]](value) : NAs introduced by coercion