Getting data from the web: scraping
Overview
- Define HTML and CSS selectors
- Introduce the
rvestpackage - Demonstrate how to extract information from HTML pages
- Practice scraping data
Before class
- Install
rvest - GET AN API KEY
- (optional) Register on geonames
- Chapter 1 and 4 in Web Scraping with R
Several packages are needed for this week’s lectures–you will need to install packages and get API keys
Additional Resources
rvestdocumentationhttrdocumentation- Web Scraping using R Cheat Sheet
- More install-and-play API packages for R
Class materials
- Run the code below in your console to download today’s in-class
exercises:
usethis::use_course("CFSS-MACSS/web-scraping")