Learn R Programming

textpress (version 1.1.0)

fetch_wiki_urls: Fetch Wikipedia page URLs by search query

Description

Uses the MediaWiki API to get Wikipedia article URLs matching a keyword. Does not search your local corpus; it retrieves links from Wikipedia. Use read_urls to get article content from these URLs.

Usage

fetch_wiki_urls(query, limit = 10)

Value

A character vector of full Wikipedia article URLs.

Arguments

query

Search phrase (e.g. "117th Congress").

limit

Number of page URLs to return (default 10).

Examples

Run this code
if (FALSE) {
wiki_urls <- fetch_wiki_urls("January 6 Capitol attack")
corpus <- read_urls(wiki_urls[1])
}

Run the code above in your browser using DataLab