wiki_section: Get a Section from a Wikipedia Page

Description Usage Arguments Value Examples

View source: R/wiki_section.R

Description

Returns an HTML object that contains the requested section of the web page. Useful for getting a section of a long Wikipedia page to pass to [wiki_table()].

Usage

1
wiki_section(page, section, delay = 1)

Arguments

page

Either a url to a wikipediea page, or an object that contains the body of a wikipedia page (e.g. from ws_scrape_page).

section

The header or css id of the section to retrieve

delay

Rate at which to throttle calls. There is no delay if the function is passed an HTML object (e.g. from wiki_page). Defaults to 1, delay can be turned off by setting this value to 0. Time between calls is determined by multiplying the value of this parameter with the server's response time.

Value

Returns an HTML object that contains the requested section of the web page.

Examples

1
2
3
wiki_page("List_of_metro_systems")
# is equivelant to
wiki_page("https://wikipedia.org/wiki/List_of_metro_systems")

niedermansam/wikiScraper documentation built on Nov. 4, 2019, 10:06 p.m.