Skip to content

Instantly share code, notes, and snippets.

@cattleguard
Last active November 17, 2017 23:31
Show Gist options
  • Save cattleguard/9a6536222af4bd9a8964cdf0602141a4 to your computer and use it in GitHub Desktop.
Save cattleguard/9a6536222af4bd9a8964cdf0602141a4 to your computer and use it in GitHub Desktop.
library(rvest)
winners <- read_html("https://www.bigtexan.com/72oz-hall-fame/")
count <- winners %>%
html_nodes(xpath = '//*[@id="post-371"]/div/div[3]/div/div/div/table/tbody//tr/td[1]') %>%
html_text()
date <- winners %>%
html_nodes(xpath = '//*[@id="post-371"]/div/div[3]/div/div/div/table/tbody//tr/td[2]') %>%
html_text()
name <- winners %>%
html_nodes(xpath = '//*[@id="post-371"]/div/div[3]/div/div/div/table/tbody//tr/td[3]') %>%
html_text()
time <- winners %>%
html_nodes(xpath = '//*[@id="post-371"]/div/div[3]/div/div/div/table/tbody//tr/td[4]') %>%
html_text()
weight <- winners %>%
html_nodes(xpath = '//*[@id="post-371"]/div/div[3]/div/div/div/table/tbody//tr/td[5]') %>%
html_text()
age <- winners %>%
html_nodes(xpath = '//*[@id="post-371"]/div/div[3]/div/div/div/table/tbody//tr/td[6]') %>%
html_text()
city.state <- winners %>%
html_nodes(xpath = '//*[@id="post-371"]/div/div[3]/div/div/div/table/tbody//tr/td[7]') %>%
html_text()
comments <- winners %>%
html_nodes(xpath = '//*[@id="post-371"]/div/div[3]/div/div/div/table/tbody//tr/td[8]') %>%
html_text()
big.texan <- data.frame(count, date, name, time, weight, age, city.state, comments)
write.csv(big.texan, file = "/bigtexan.csv", row.names = FALSE)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment