I have a website that has several hundred PDFs. I need to iterate through, and download every PDF to my local machine. I would like to use rvest. Attempt:
library(rvest)
url <- "https://example.com"
scrape <- url %>%
read_html() %>%
html_node(".ms-vb2 a") %>%
download.file(., 'my-local-directory')
How do I grab each PDF from the link? The download.file()
does not work, and I have no clue how to get each file. I just get this error:
Error in doc_parse_raw(x, encoding = encoding, base_url = base_url, as_html = as_html, : xmlParseEntityRef: no name [68]