Created
October 13, 2014 17:17
-
-
Save mharris717/bbb5f161ddabf444e6df to your computer and use it in GitHub Desktop.
Parse UFC
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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