R:html_table返回表标题,但没有表内容

时间:2019-04-03 12:26:31

标签: r

我正在尝试使用R从https://www.timeshighereducation.com/world-university-rankings/2019/world-ranking#!/page/0/length/100/sort_by/rank/sort_order/asc/cols/stats抓取大学排名表。我只能获取表标题,但我真正想要的是整个数据。

library(rvest)
library(tidyverse)
url<- read_html("https://www.timeshighereducation.com/world-university-rankings/2019/world-ranking#!/page/0")

html_nodes(url, "#datatable-1") %>% html_table()

结果

> html_nodes(url, "#datatable-1") %>% html_table()
[[1]]
 [1] rank order                Rank                      Name                      Node ID                   Overall                  
 [6]                           Teaching                                            Research                                           
[11] Citations                                           Industry Income                                     International Outlook    
[16]                                                                                                                                  
[21]                                                     No. of FTE Students       No. of students per staff International Students   
[26] Female:Male Ratio        
<0 rows> (or 0-length row.names)

我想要的结果将是数据帧中捕获的表中的整个数据,而不只是时序标题。知道怎么了吗?

0 个答案:

没有答案