I am currently teaching myself to webscape in R and have been running into trouble understanding exactly how to go about it. I am specifically trying to learn how to download multiple PDF's on a page that are all accessed through individual links (see the website here for reference). I have been watching and reading guides for two different packages (rvest & RSelenium) but have come up short on my understanding. I know I could simply just click and download these items, however I wanted to learn this process as I think it would really simplify future projects. I am relatively comfortable using R for data analytics and model building, however I am pretty much only have very base knowledge of computer science beyond R If anyone has either any advice or links to guides they found helpful that would be greatly appreciated!
what I've most recently been rying to do is repurpose the code from this article to get it work. However I don't think the links for the PDFs I want follow the same formatting that would allow this code to work:
library(tidyverse)
library(rvest)
page %>% html_node("a") %>% html_attr("href") %>% str_subset("\\.pdf") %>% str_c("https://osse.dc.gov", .) %>% map(read_html) %>% map(html_node, "#raw-url") %>% map(html_attr, "href") %>% str_c("https://osse.dc.gov", .) %>% walk2(., basename(.), download.file, mode = "wb")