【发布时间】:2021-12-31 01:30:42
【问题描述】:
我想使用rvest 从https://irelandsgreatwardead.ie/the-archive/ 刮一张表(包含关于 31,385 名士兵的信息)。
library(rvest)
library(dplyr)
page <- read_html(x = "https://irelandsgreatwardead.ie/the-archive/")
table <- page %>%
html_nodes("table") %>%
html_table(fill = TRUE) %>%
as.data.frame()
这有效,但仅适用于前 10 名士兵。在源代码中,我也只能看到前 10 名士兵的信息。任何有关如何与其他士兵一起获得行数的帮助将不胜感激!
谢谢,祝你有美好的一天!
【问题讨论】:
-
如果你使用第2页等的链接,你能得到下10个吗?
-
感谢您的评论,卡卢姆!不幸的是,第 2 页的 URL 与第 1 页的 URL 相同。还是您引用了其他内容?
标签: r web-scraping html-table rvest rselenium