title: Beautifulsoup if class exists
body: <p>Is there a way to make BeautifulSoup look for a class and if it exists then run the script? I am trying this:</p>
  
  <pre><code>if soup.find_all("div", {"class": "info"}) == True:
      print("Tag Found")
  </code></pre>
  
  <p>I've also tried but it didn't work and gave an error about having too many attributes:</p>
  
  <pre><code>if soup.has_attr("div", {"class": "info"})
      print("Tag Found")
  </code></pre>