I'm trying to scrape data off roster data from http://stats.nba.com/team/#!/1610612742/. So far, I've tried RCurl and XML packages and the code I'v tried is as follows:
library(RCurl)
library(XML)
webpage <- getURL("http://stats.nba.com/team/#!/1610612742/")
webpage <- readLines(tc <- textConnection(webpage));
pagetree <- htmlTreeParse(webpage, useInternalNodes = TRUE)
x <- unlist(xpathApply(pagetree,"//*nba-stat-table_overflow/player",xmlValue))
Content <- gsub(pattern = "([\t\n])",
replacement = " ", x = x, ignore.case = TRUE)
I believe that my xpathApply function is formatted wrong. What path should I give it to get to the roster table?