R
Size: a a a
R
O
require(rvest)
require(openxlsx)
spr_books <- read.xlsx("Free+English+textbooks.xlsx")
dl_dir <- "Downloads"
if (!dir.exists(dl_dir)) dir.create(dl_dir)
for (i in 1:nrow(spr_books)) {
pkg_dir <- spr_books[i, "English.Package.Name"]
dest_dir <- paste0(dl_dir, "/", pkg_dir, "/")
if (!dir.exists(dest_dir)) dir.create(dest_dir)
url1 <- spr_books[i, "OpenURL"]
webpage <- read_html(url1)
link <-
webpage %>%
html_nodes(".test-bookpdf-link") %>% html_attr('href')
book_name <- paste0(dest_dir, gsub("/", "-", spr_books[i, "Book.Title"]), ".pdf")
if (!file.exists(book_name))
download.file(paste0("https://link.springer.com", link[1]), book_name, mode="wb")
cat(paste("#", i, " ", spr_books[i, "Book.Title"]), sep = "\n")
}
O
O
springerQuarantineBooksR
не поставилсяEP
springerQuarantineBooksR
не поставилсяМЗ
a
DB
АК
a
a
a
a
PD
PD
S
S
EK