【发布时间】:2020-07-27 07:18:57
【问题描述】:
我希望从位于https://thearcfooty.com/2017/01/28/a-complete-history-of-the-afl/ 的表中提取所有记录
我面临的挑战是它是一个滚动表格(表格底部的文本显示它包含 31,228 条记录:
Showing 1 to 10 of 31,228 entries
我是 Rvest 的新手,在 Google Chrome 中检查了表格后尝试了以下操作:
library(rvest)
url <- "https://thearcfooty.com/2017/01/28/a-complete-history-of-the-afl/"
Table <- url %>%
read_html() %>%
html_nodes(xpath= '//*[@id="table_1"]') %>%
html_table()
TableNew <- Table[[1]]
TableNew
但它只是不断挂起。理想情况下,我想返回一个包含所有行和所有列的所有记录的数据框。
【问题讨论】:
标签: r web-scraping rvest