title: Make BeautifulSoup Data into a DataFrame Python
body: <p>I am new to Python. But I am scraping the web for data and get the data but am having trouble putting the data into a dataframe. It seems that I can only get one line of data in the dataframe.</p>
  <pre><code>    n=range(2009,2021)
  
  url2 ='https://www.sports-reference.com/cbb/seasons/'
  url3 ='-school-stats.html'
  
  for n in n:
      all = url2+str(n)+url3
      r = requests.get(all)
      soup = BeautifulSoup(r.text, 'html.parser')
      league_table = soup.find('table', class_ = 'per_match_toggle sortable stats_table')
      for team in league_table.find_all('tbody'):
          rows = team.find_all('tr')
          for row in rows:
              pl_team = row.find('td', class_ = 'left')
              if pl_team == (None):
                  continue
              pl_wins = row.find_all('td', class_ = 'right')[1]
              if pl_wins == (None):
                  continue
              pl_loses = row.find_all('td', class_ = 'right')[2]
              if pl_wins == (None):
                  continue
              pl_total_points = row.find_all('td', class_ = 'right')[16]
              if pl_total_points == (None):
                  continue
              pl_total_points_againest = row.find_all('td', class_ = 'right')[17]
              if pl_total_points_againest == (None):
                  continue
              pl_FG_percentage = row.find_all('td', class_ = 'right')[22]
              if pl_FG_percentage == (None):
                  continue
              pl_3_percentage = row.find_all('td', class_ = 'right')[25]
              if pl_3_percentage == (None):
                  continue
              pl_FT_percentage = row.find_all('td', class_ = 'right')[28]
              if pl_FT_percentage == (None):
                  continue
              pl_total_rebounds = row.find_all('td', class_ = 'right')[30]
              if pl_total_rebounds == (None):
                  continue
              pl_assist = row.find_all('td', class_ = 'right')[31]
              if pl_assist == (None):
                  continue
              pl_steals = row.find_all('td', class_ = 'right')[32]
              if pl_steals == (None):
                  continue
              pl_turnovers = row.find_all('td', class_ = 'right')[33]
              if pl_total_rebounds == (None):
                  continue
              print(n,
                    pl_team.text, 
                    pl_wins.text, 
                    pl_loses.text, 
                    pl_total_points.text, 
                    pl_total_points_againest.text, 
                    pl_FG_percentage.text,
                    pl_3_percentage.text,
                    pl_FT_percentage.text, 
                    pl_total_rebounds.text,
                    pl_assist.text,
                    pl_steals.text,
                    pl_turnovers.text,
                   )
              data = {'Year': n,
                     'Team': pl_team.text,
                     'Wins': pl_wins.text}
  </code></pre>
  <p>The Output gives me this example (1000 more rows):</p>
  <pre><code>2009 Air Force 10 21 1821 1936 .440 .377 .674 879 378 155 70
  2009 Akron NCAA 23 13 2403 2171 .418 .332 .708 1199 446 270 80
  2009 Alabama A&amp;M 8 19 1761 1954 .388 .267 .665 948 298 224 90
  2009 Alabama-Birmingham 22 12 2461 2244 .455 .337 .707 1169 430 224 69
  2009 Alabama State NCAA 22 10 2202 2025 .466 .329 .634 1130 445 182 153
  </code></pre>
  <p>But when I print &quot;data&quot; I only get one line I know its not a DataFrame but I cant get the DF to work either:</p>
  <pre><code>{'Year': 2020, 'Team': 'Youngstown State', 'Wins': '18'}
  </code></pre>