rseleniumrvestrseleniumpdftools

Do I need to use RSelenium to download these PDFs?


I am trying to use rvest and pdftools to go through this page and download the PDFs. I'm having trouble using CSS selector to do this, and wondering if this might take a webdriver?

Also, is it easy enough to use a webdriver to do this in R - as a bit of a beginner R user?


Solution

  • The solution could be download.file() function.

    Suppose that we have detected all files links and we have a list.

    url <- "https://northernbrucepeninsula.civicweb.net/filepro/documents/?preview=56705"
    
    download.file(url, destfile, quiet = TRUE)
    

    url = the link of the file that you want to donwload.

    destfile = a character string (or vector, see url) with the name where the downloaded file is saved. Tilde-expansion is performed.

    quiet = If TRUE, suppress status messages (if any), and the progress bar.