I am trying to scrape data frame the following website
http://stats.nba.com/game/0041700404/playbyplay/
I'd like to create a table that includes the date of the game, the scores throughout the game, and the team names
I am using the following code:
game1 <- read_html("http://stats.nba.com/game/0041700404/playbyplay/")
#Extracts the Date
html_nodes(game1, xpath = '//*[contains(concat( " ", @class, " " ), concat( " ", "game-summary-team--vtm", " " ))]//*[contains(concat( " ", @class, " " ), concat( " ", "game-summary-team__lineup", " " ))]')
#Extracts the Score
html_nodes(game1, xpath = '//*[contains(concat( " ", @class, " " ), concat( " ", "status", " " ))]//*[contains(concat( " ", @class, " " ), concat( " ", "score", " " ))]')
#Extracts the Team names
html_nodes(game1, xpath = '//*[contains(concat( " ", @class, " " ), concat( " ", "game-summary-team__name", " " ))]//a')
Unfortunately, I get the following
{xml_nodeset (0)}
{xml_nodeset (0)}
{xml_nodeset (0)}
I have seen a bunch of questions and answers to this problem but none of them seem to help.