scrape_books | R Documentation |
This function scrapes details of books using their IDs from Goodreads.
scrape_books(book_ids_path, use_parallel = FALSE, num_cores = 4)
book_ids_path |
Path to a text file containing book IDs. |
use_parallel |
Logical indicating whether to scrape in parallel (default is FALSE). |
num_cores |
Number of CPU cores to use for parallel scraping (default is 4). |
A data frame containing scraped book details.
# Create a temporary file with sample book IDs
temp_file <- tempfile(fileext = ".txt")
writeLines(c("1420", "2767052", "10210"), temp_file)
# Run the function (with a small delay to avoid overwhelming the server)
result <- scrape_books(temp_file, use_parallel = FALSE)
print(head(result))
# Clean up: remove the temporary file
file.remove(temp_file)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.