Script to download nested PDF books from a WEB Page

This is a WEB Scraping & WEB Crawler function.

This short function downloads all the PDF book files and saves locally, from the main WEB page, one file at a time, the PDFs are at second level WEB pages for each book:

getBooks[bookUrl_]:=
 URLDownload[
  Select[Flatten[
    Import[#, "Hyperlinks"] & /@ 
     Import[bookURL, "Hyperlinks"]], 
   StringContainsQ[#, ".pdf"] &], 
  "~/Downloads/Books", 
  CreateIntermediateDirectories -> True];


getBooks["https://books.goalkicker.com/"]
2 Likes

The 1st line should be:

getBooks[bookURL_String] :=

just a copy/paste error.

It is funny because it is getBooks[bookUrl_]:= at edit mode… gets this way when published…

Better now!!