title: Locating tags via styles - using Python 2 and BeautifulSoup 4
body: <p>I am trying to use BeautifulSoup 4 to extract text from specific tags in an HTML Document. I have HTML that has a bunch of div tags like the following:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div style="position:absolute; border: textbox 1px solid; writing-mode:lr-tb; left:42px; top:90px; width:195px; height:24px;"&gt;
    &lt;span style="font-family: FIPXQM+Arial-BoldMT; font-size:12px"&gt;
      Futures Daily Market Report for Financial Gas
      &lt;br/&gt;
      21-Jul-2015
      &lt;br/&gt;
     &lt;/span&gt;
  &lt;/div&gt;
  &lt;div style="position:absolute; border: textbox 1px solid; writing-mode:lr-tb; left:54px; top:135px; width:46px; height:10px;"&gt;
    &lt;span style="font-family: FIPXQM+Arial-BoldMT; font-size:10px"&gt;
      COMMODITY
      &lt;br/&gt;
     &lt;/span&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>I am trying to get the text from all span tags that are in any div tag that has a style of "left:54px". </p>
  
  <p>I can get a single div if i use:</p>
  
  <pre><code>soup = BeautifulSoup(open(extracted_html_file))
  print soup.find_all('div',attrs={"style":"position:absolute; border: textbox 1px solid; "
                                           "writing-mode:lr-tb; left:42px; top:90px; "
                                           "width:195px; height:24px;"})
  </code></pre>
  
  <p>It returns:</p>
  
  <pre><code>[&lt;div style="position:absolute; border: textbox 1px solid; writing-mode:lr-tb; left:42px; top:90px; width:195px; height:24px;"&gt;&lt;span style="font-family: FIPXQM+Arial-BoldMT; font-size:12px"&gt;Futures Daily Market Report for Financial Gas
  &lt;br/&gt;21-Jul-2015
  &lt;br/&gt;&lt;/span&gt;&lt;/div&gt;]
  </code></pre>
  
  <p>But that only gets me the one div that exactly matches that styling. I want all divs that match only the "left:54px" style.</p>
  
  <p>To do this, I've tried a few different ways:</p>
  
  <pre><code>soup = BeautifulSoup(open(extracted_html_file))
  print soup.find_all('div',style='left:54px')
  print soup.find_all('div',attrs={"style":"left:54px"})
  print soup.find_all('div',attrs={"left":"54px"})
  </code></pre>
  
  <p>But all these print statements return empty lists.</p>
  
  <p>Any Ideas?</p>