diff --git a/scripts/make_screenshots.R b/scripts/make_screenshots.R index 5c607084..c57a182e 100644 --- a/scripts/make_screenshots.R +++ b/scripts/make_screenshots.R @@ -52,16 +52,16 @@ if (!dir.exists(output_folder)) { if (is.null(opt$base_url)) { base_url <- cow::get_pages_url(repo_name = opt$repo, git_pat = opt$git_pat) + base_url <- gsub("/$", "", base_url) } chapt_df <- ottrpal::get_chapters(base_url = file.path(base_url, "no_toc/")) - file_names <- lapply(chapt_df$url, function(url) { file_name <- gsub(".html", ".png", file.path(output_folder, basename(url))) # Get rid of special characters - file_name <- gsub(":|?|!|\\'", "", file_name) webshot::webshot(url, file_name) + file_name <- gsub(":|?|!|\\'", "", file_name) message(paste("Screenshot saved:", file_name)) return(file_name) })