title: Trying to use rvest to loop a command to scrape tables from multiple pages
body: <p>I'm trying to scrape HTML tables from different football teams. Here is the table I want to scrape, however I want to scrape that same table from all of the teams to ultimately create a single CSV file that has the player names and their data.</p>
  
  <p><a href="http://www.pro-football-reference.com/teams/tam/2016_draft.htm" rel="nofollow noreferrer">http://www.pro-football-reference.com/teams/tam/2016_draft.htm</a></p>
  
  <pre><code># teams
  teams &lt;- c("ATL", "TAM", "NOR", "CAR", "GNB", "DET", "MIN", "CHI", "SEA", "CRD", "RAM", "NWE", "MIA", "BUF", "NYJ", "KAN", "RAI", "DEN", "SDG", "PIT", "RAV", "SFO", "CIN", "CLE", "HTX", "OTI", "CLT", "JAX", "DAL", "NYG", "WAS", "PHI")
  
  # loop
  for(i in teams) {
    url &lt;-paste0("http://www.pro-football-reference.com/teams/", i,"/2016-snap-counts.htm#snap_counts::none", sep="")
    webpage &lt;- read_html(url)
  
    # grab table
    sb_table &lt;- html_nodes(webpage, 'table')
  html_table(sb_table)
  head(sb_table)
    # bind to dataframe
  df &lt;- rbind(df, sb_table)
  }
  </code></pre>
  
  <p>I'm getting an error thought that I should use CSS or Xpath and not both, but I can't figure out where the problem is exactly (I suspect the html_nodes command). Can anyone help me fix this problem?</p>