【发布时间】:2017-10-15 14:04:20
【问题描述】:
我正在尝试从此 URL 中抓取表格: "https://hutdb.net/17/players" 我花了很多时间学习 rvest 和使用 selectorgadget,但是每当我尝试获得输出时,我总是会遇到相同的错误(Character(0))。
library(rvest)
library(magrittr)
url <- read_html("https://hutdb.net/17/players")
table <- url %>%
html_nodes("td") %>%
html_text()
任何帮助将不胜感激。
【问题讨论】:
-
数据是动态加载的,无法直接从html中获取。但是,查看“网络”,我们可以在 hutdb.net/ajax/… 找到格式良好的 JSON