csfd_fetch: Issue A Scrape Request

View source: R/fetch.R

csfd_fetchR Documentation

Issue A Scrape Request

Description

Download a page from the Czech and Slovak Film Database (CSFD).

Usage

csfd_fetch(url, quiet = FALSE)

Arguments

url

A CSFD URL, incl. a partial one, e.g. "/film/9834-star-trek-film"

quiet

If TRUE, request status will not be printed on the console.

This indicates whether the request is being executed or has been completed and with what status. It also prints out the response URL which may be different from the request URL, because the server always returns a complete URL rather than just the resource identifier.

Details

This function fetches HTML from a single URL. The resulting object contains a set of fields for scraping different parts of the page. For all available scrapers, see csfd_scraper_list.

Note that rate is throttled at 15 requests per minute.

Value

An object of class csfd_scraper.

Examples


## Not run: 

# Partial URL works:
trek79 <- csfd_fetch("/film/9834-star-trek-film/prehled/")
trek79

# Even shorter:
trek79 <- csfd_fetch("film/9834")
trek79

# Extract data like you would extract elements from a list:
trek79$details
trek79$reviews
trek79$ratings

# Careful with TV show seasons, they have two different identifiers - you
# want the second one. For example:
# /film/68990-star-trek-hluboky-vesmir-devet/494010-serie-1/prehled/
ds9 <- csfd_fetch("film/494010")

## End(Not run)

jchrom/csfd documentation built on Oct. 26, 2022, 10:19 p.m.