I have written the code below to extract all speeches given by the FLOTUS at this link. Here is the code:
library(rvest)
library(purrr)
url_base <- "https://www.presidency.ucsb.edu/documents/presidential-documents-archive-guidebook/remarks-and-statements-the-first-lady-laura-bush?page=%d"
map_df(1:17, function(i) {
# simple but effective progress indicator
cat(".")
pg <- read_html(sprintf(url_base, i))
data.frame(name=html_text(html_nodes(pg, ".views-field-title-1.nowrap")),
title=html_text(html_nodes(pg, "td.views-field-title")),
year=html_text(html_nodes(pg, ".date-display-single")),
stringsAsFactors=FALSE)
}) -> flotus
I would like to use this code to extract the text of the corresponding speeches as well. Does anyone know how to do that with the code I've already written? If so, what would that look like?