wiki_page: Get HTML from Wikipedia Page

Description Usage Arguments Value Examples

View source: R/wiki_page.R

Description

Returns a list containing the contents of the requested webpage. Useful in conjunction with [wiki_table()], [wiki_card()], and [wiki_section()]. This function is a wrapper around the function [xml2::get_html()].

Usage

1
wiki_page(page, url = "https://wikipedia.org/wiki/", delay = 1)

Arguments

page

Extension of the page, e.g. "New_York_City"

url

The base url of the site to visit, defaults to "https://wikipedia.org/wiki/"

delay

Rate at which to throttle calls. Defaults to 1, can be turned off by setting to 0. Time between calls is determined by multiplying the value of this parameter with the response time by the server.

Value

An object that contains the HTML content of the requested URL.

Examples

1
2
3
4
5
wiki_page("New York City")
# is equivelant to
wiki_page("https://wikipedia.org/wiki/New_York_City")
# and
#xml2::read_html("https://wikipedia.org/wiki/New_York_City")

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