ScrapeDebate: Scraper Functions for Debates

Description Usage Arguments Details Value Examples

Description

Functions to scrape Debates from https://www.presidency.ucsb.edu or https://www.debates.org/

Usage

1
2
3

Arguments

url

A URL in quotes

Details

Use scrapeDebUCSB for texts from https://www.presidency.ucsb.edu and use scrapeDebOrg for texts from https://www.debates.org/voter-education/debate-transcripts/. Since the websites are set up a bit differently, the functions are adjusted to account for the difference CSS labels of the main text. Both return a text string which can then be manipulated as desired.

Value

text string in the format SPEAKERA: text SPEAKERB: text with line breaks between the speakers

Examples

1
2
3
4
5
6
7
# Debates from https://www.presidency.ucsb.edu
url <- "https://www.presidency.ucsb.edu/documents/presidential-debate-washington-university-st-louis-missouri"
Debate <- scrapeDebUCSB(url) # Scrape 2016 Presidential Debate

# Debates from Debates.org
url <- "https://www.debates.org/voter-education/debate-transcripts/september-26-2016-debate-transcript/"
Debate <- scrapeDebOrg(url)

lin-jennifer/poltextr documentation built on Dec. 30, 2020, 1:38 p.m.