I've recently starting using R again after a long hiatus and I'm extremely rusty, especially when it comes to html and scraping data (w/rvest).
My main issue right now is identifying the correct nodes/'XPath' to input into my function to get it to pull the correct data, more specifically, I'm trying to scrape college hockey play-by-play data from the NCAA website (example)....
I've tried numerous approaches without any success.. for example:
Since it seems each period's data is nested in separate "div.play-by-play-period" classes(?), I tried focusing on scraping one period, then building from there...
So I drilled down to the table containing the 1st period's data ('tbody') and copy the xpath and pasted into the code below:
url <- "https://www.ncaa.com/game/5935492/play-by-play"
gm <- url %>%
read_html() %>%
html_nodes(xpath='//*[@id="gamecenterAppContent"]/div/div[3]/div[2]/table/tbody') %>%
html_table()
Resulting in a "List of 0"...
Any help would be greatly appreciated!