Skip to content

Instantly share code, notes, and snippets.

@amoeba
Created November 5, 2015 19:59
Show Gist options
  • Select an option

  • Save amoeba/652bd2cdfc467a98914f to your computer and use it in GitHub Desktop.

Select an option

Save amoeba/652bd2cdfc467a98914f to your computer and use it in GitHub Desktop.
library(rvest)
url <- "http://access.afsc.noaa.gov/REEM/WebDietData/DietTable.php?NODC=8857041501&Year=2007&Region=GOA"
page <- read_html(url)
column_names <- page %>% html_nodes(".afscbody table tr:first-child td ") %>% html_text()
column_names
table_data <- page %>% html_nodes(".afscbody table tr:not(:first-child) td ") %>% html_text()
table_data
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment