save_codes: Download multiple results pages as html files

Description Usage Arguments Value Examples

View source: R/save_codes.R

Description

Downloads one or more CDC URLs as html files with a specific wait-time to avoid IP address blocking.

Usage

1
save_codes(urls, browser = "firefox")

Arguments

urls

One or more URLs corresponding to pages of CDC search results.

browser

The name of the browser used for scraping. Default is 'firefox'.

Value

A list of objects containing the HTML codes for each file. Text files containing the code are also saved to the working directory.

Examples

1
2
3
4
urls <- c("https://search.cdc.gov/search/index.html?all=disease%20spread&none=animal%20fish&exact=corona%20virus&any=pandemic%20global&date1=01%2F01%2F1980&date2=10%2F11%2F2020&dpage=1#results",
"https://search.cdc.gov/search/index.html?all=disease%20spread&none=animal%20fish&exact=corona%20virus&any=pandemic%20global&date1=01%2F01%2F1980&date2=10%2F11%2F2020&dpage=2#results",
"https://search.cdc.gov/search/index.html?all=disease%20spread&none=animal%20fish&exact=corona%20virus&any=pandemic%20global&date1=01%2F01%2F1980&date2=10%2F11%2F2020&dpage=3#results")
codes <- save_codes(urls);

nealhaddaway/CDCscraper documentation built on Oct. 21, 2020, 5:20 a.m.