scrape_books: Scrape book details from Goodreads

View source: R/scrape_books.R

scrape_booksR Documentation

Scrape book details from Goodreads

Description

This function scrapes details of books using their IDs from Goodreads.

Usage

scrape_books(book_ids_path, use_parallel = FALSE, num_cores = 4)

Arguments

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).

Value

A data frame containing scraped book details.

Examples


# 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)


Goodreader documentation built on Oct. 30, 2024, 9:11 a.m.