Skip to content

Instantly share code, notes, and snippets.

@mharris717
Created October 13, 2014 17:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mharris717/bbb5f161ddabf444e6df to your computer and use it in GitHub Desktop.
Save mharris717/bbb5f161ddabf444e6df to your computer and use it in GitHub Desktop.
Parse UFC
library(rvest)
page <- html("http://www.sherdog.com/events/UFC-Fight-Night-MacDonald-vs-Saffiedine-35509")
rows <- page %>%
html_nodes("tr[itemprop=subEvent]")
for (row in rows) {
names <- row %>%
html_nodes("span[itemprop=name]") %>%
html_text()
full <- paste(names[1],names[2], sep=" vs ")
print(full)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment