0

I an attempt to run the following code to scrape the table titled "Advanced", whos id is also dictated as "advanced":

url <- paste0("https://www.basketball-reference.com/teams/GSW/2016.html")
      webpage <- read_html(url)
      col_names <- webpage %>% 
        html_nodes("table#advanced")

However, when I run this code and try to print col_names, I receive the following value: {xml_nodeset (0)}. How can I properly scrape my desired table?

Martin Schmelzer
  • 23,283
  • 6
  • 73
  • 98
  • The table I am attempting to scrape is titled "Advanced" and its `id` is listed as `advanced`. It is about 1/4 of the way down the page. It is a subset of `div id` `content` – Arnav Harkenavvy Sep 15 '19 at 01:46
  • Table is in comments. You need to extract from there. There are existing answers on SO for this e.g. https://stackoverflow.com/questions/40616357/how-to-scrape-tables-inside-a-comment-tag-in-html-with-r (have a look at some of the existing. This was just the first Google SO return.) – QHarr Sep 15 '19 at 05:15

0 Answers0