title: Python, beautiful soup, get all class name
body: <p>given an html code lets say:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code> &lt;div class="class1"&gt;
      &lt;span class="class2"&gt;some text&lt;/span&gt;
      &lt;span class="class3"&gt;some text&lt;/span&gt;
      &lt;span class="class4"&gt;some text&lt;/span&gt;
      &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>How can I retrieve all the class names? ie: ['class1','class2','class3','class4']</p>
  
  <p>I tried:</p>
  
  <pre><code>soup.find_all(class_=True)
  </code></pre>
  
  <p>But it retrieves the whole tag and i then need to do some regex on the string</p>