title: Filtering out HTML elements which have 'display:none' either as a tag attribute or in their CSS
body: <p>Let's say you have some html source that's been scraped with Selenium, and parsed with BeautifulSoup:</p>
  
  <pre><code>from selenium import webdriver
  from bs4 import BeautifulSoup
  
  driver = webdriver.Firefox()
  driver.get(url)
  soup = BeautifulSoup(driver.page_source)
  </code></pre>
  
  <p>Is there a way to remove, from the html code or the soup object, all elements which either have:</p>
  
  <p>1.) the attribute <code>style=display:none</code> within the html tag source (i.e. <code>&lt;div style = 'display:none'&gt;...&lt;/div&gt;</code>)</p>
  
  <p>or</p>
  
  <p>2.) have the <code>display:none</code> property within the page's CSS</p>