Learn R Programming

textpress (version 1.1.0)

fetch_wiki_refs: Fetch external citation URLs from Wikipedia

Description

Searches Wikipedia for a topic, then returns external citation URLs from the first matching page's references section. Use read_urls to scrape content from those URLs.

Usage

fetch_wiki_refs(query, n = 10)

Value

A character vector of external citation URLs (prefers archived when present).

Arguments

query

Search phrase (e.g. "January 6 Capitol attack").

n

Number of citation URLs to return (default 10).

Examples

Run this code
if (FALSE) {
ref_urls <- fetch_wiki_refs("January 6 Capitol attack", n = 10)
articles <- read_urls(ref_urls)
}

Run the code above in your browser using DataLab