【发布时间】:2015-11-17 13:45:37
【问题描述】:
我正在尝试使用 R(更具体地说是 rvest 包)在 familySearch.org(请参阅下面的 URL)上抓取巴西记录表。
拳头用“selctor gadget”选择了网站上的表格。根据我单击选择器的方式返回:“#hr-data-table”或“td”。它们似乎都不起作用:
library(rvest)
url <- 'https://familysearch.org/search/record/results?count=75&englishSubcountryName=Brasil&query=%2Brecord_country%3ABrazil%20%2Brecord_subcountry%3A'
url %>% html() %>% html_node("#hr-data-table") %>% html_text()
Error in xml_apply(x, XML::xmlValue, ..., .type = character(1)) :
Unknown input of class: NULL
url %>% html() %>% html_node("td") %>% html_text()
[1] ""
#replacing html_text() with html_table() also does not work.
关于如何完成这项工作的任何想法,最好是在 R 中?
【问题讨论】:
标签: r web-scraping rvest