title: BeautifulSoup - How do I get all <div> from a class in html?
body: <p>I am trying to get a list of all NFL teams from a website and I am very close. I am able to get some data, but I can't drill down far enough to get what I want.</p>
  <p>My code:</p>
  <pre><code>from bs4 import BeautifulSoup
  import requests
  
  f = open('C:\Users\Josh\Documents\Python\outFileRoto.txt', 'w')
  errorFile = open('C:\Users\Josh\Documents\Python\errors.txt', 'w')
  
  
  
  r  = requests.get('https://rotogrinders.com/team-stats/nfl-allowed?sport=nfl&amp;position=QB&amp;site=draftkings&amp;range=season')
  data = r.text
  #soup = BeautifulSoup(urllib2.urlopen('http://games.espn.com/ffl/tools/projections?startIndex=' +str(x).read(), 'html')
  soup = BeautifulSoup(data, 'html.parser')
  leftTable = soup.find('div', attrs={'class' : 'rgt-bdy left'})
  #f.write(&quot;LEFT TABLE\n&quot; + str(leftTable) + '\n')
  
  rightCol = leftTable.find('div', attrs={'class' : 'rgt-colwrap'})
  
  for row in rightCol.findAll('div'):
      #col = row.findAll('div')
      #f.write(&quot;col&quot; + str(col))
  
      try:
          name = str(row)
          f.write(&quot;----------------------------COLUMN---------------------------\n&quot; + name + '\n')
      
      except Exception as e:
          errorFile.write (str(x) + &quot;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&quot; + str(a) + &quot;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;ROW&quot; + str(row) + '\n')
          pass
          
  
  f.close
  errorFile.close
  </code></pre>
  <p>The problem is that I get this:</p>
  <pre><code>----------------------------COLUMN---------------------------
  &lt;div class=&quot;rgt-col&quot;&gt;
  &lt;div class=&quot;rgt-hdr&quot;&gt;Team&lt;span class=&quot;icn-arw-down&quot;&gt;&lt;/span&gt;&lt;/div&gt;
  &lt;/div&gt;
  ----------------------------COLUMN---------------------------
  &lt;div class=&quot;rgt-hdr&quot;&gt;Team&lt;span class=&quot;icn-arw-down&quot;&gt;&lt;/span&gt;&lt;/div&gt;
  ----------------------------COLUMN---------------------------
  &lt;div class=&quot;rgt-col&quot;&gt;
  &lt;div class=&quot;rgt-hdr&quot;&gt;Abbr&lt;span class=&quot;icn-arw-down&quot;&gt;&lt;/span&gt;&lt;/div&gt;
  &lt;/div&gt;
  ----------------------------COLUMN---------------------------
  &lt;div class=&quot;rgt-hdr&quot;&gt;Abbr&lt;span class=&quot;icn-arw-down&quot;&gt;&lt;/span&gt;&lt;/div&gt;
  </code></pre>
  <p>But I need this:</p>
  <p><img src="https://i.stack.imgur.com/gPuXf.png" alt="NFL Teams" /></p>