A simple function to scrape data from the Fugazi Live Series website using rvest.
Usage
scrape_fls_data(
mygiddata = NULL,
mylimit = 3,
sleepseconds = 1,
mycsvfilename = "gid_fls_id_sound_quality.csv",
my_data_html_element = "dd strong"
)Arguments
- mygiddata
Name of data frame containing list of gids to be scraped (optional). If this is not specified gids from othervariables will be used (1048 of them).
- mylimit
The number of shows from which to scrape sound quality rating. Set to a low number for testing.
- sleepseconds
seconds to wait before getting info from the next page.
- mycsvfilename
filename for the CSV file to which the results will be written.
- my_data_html_element
html element that contains the data to be scraped
Value
A data frame with one row per scraped show: gid, fls_id, and fls_data (the trimmed text extracted from my_data_html_element). Also written to mycsvfilename.
Examples
if (FALSE) { # \dontrun{
# Makes live requests to dischord.com - not run automatically.
scraped_data_1 <- scrape_fls_data(mygiddata = NULL, mylimit = 3, sleepseconds = 1,
mycsvfilename = "gid_fls_id_sound_quality.csv",
my_data_html_element = "dd strong")
scraped_data_2 <- scrape_fls_data(mygiddata = NULL, mylimit = 3, sleepseconds = 1,
mycsvfilename = "gid_fls_id_played_with.csv",
my_data_html_element = "dd:nth-child(10)")
} # }