title: Scraping td elements with background color style BeautifulSoup
body: <p>I am trying to parse a webpage where i want to scrape "tr" elements which have bgcolor attribute also. Below is the html for the webpage:</p>
  
  <pre><code>&lt;table cellspacing="0" cellpadding="15" id="MainContent_GridView1" style="color:#333333;border-collapse:collapse;"&gt;
      &lt;tr style="color:White;background-color:#045D99;font-weight:bold;"&gt;
          &lt;th scope="col"&gt;&lt;a href="javascript:__doPostBack(&amp;#39;ctl00$MainContent$GridView1&amp;#39;,&amp;#39;Sort$name&amp;#39;)" style="color:White;"&gt;ORGANIZATION NAME&lt;/a&gt;&lt;/th&gt;&lt;th scope="col"&gt;&lt;a href="javascript:__doPostBack(&amp;#39;ctl00$MainContent$GridView1&amp;#39;,&amp;#39;Sort$state&amp;#39;)" style="color:White;"&gt;STATE&lt;/a&gt;&lt;/th&gt;&lt;th scope="col"&gt;&lt;a href="javascript:__doPostBack(&amp;#39;ctl00$MainContent$GridView1&amp;#39;,&amp;#39;Sort$year&amp;#39;)" style="color:White;"&gt;YEAR&lt;/a&gt;&lt;/th&gt;&lt;th scope="col"&gt;&lt;a href="javascript:__doPostBack(&amp;#39;ctl00$MainContent$GridView1&amp;#39;,&amp;#39;Sort$rt&amp;#39;)" style="color:White;"&gt;FORM&lt;/a&gt;&lt;/th&gt;&lt;th scope="col"&gt;&lt;a href="javascript:__doPostBack(&amp;#39;ctl00$MainContent$GridView1&amp;#39;,&amp;#39;Sort$pc&amp;#39;)" style="color:White;"&gt;PAGES&lt;/a&gt;&lt;/th&gt;&lt;th scope="col"&gt;&lt;a href="javascript:__doPostBack(&amp;#39;ctl00$MainContent$GridView1&amp;#39;,&amp;#39;Sort$ta&amp;#39;)" style="color:White;"&gt;TOTAL ASSETS&lt;/a&gt;&lt;/th&gt;&lt;th scope="col"&gt;&lt;a href="javascript:__doPostBack(&amp;#39;ctl00$MainContent$GridView1&amp;#39;,&amp;#39;Sort$ein&amp;#39;)" style="color:White;"&gt;EIN&lt;/a&gt;&lt;/th&gt;
      &lt;/tr&gt;&lt;tr style="color:#333333;background-color:#ECEEF2;"&gt;
          &lt;td&gt;&lt;a href="//990s.foundationcenter.org/990_pdf_archive/231/231352298/231352298_201702_990.pdf"&gt;Zoological Society of Philadelphia Philadelphia Zoo&lt;/a&gt;&lt;/td&gt;&lt;td&gt;PA&lt;/td&gt;&lt;td&gt;2017&lt;/td&gt;&lt;td&gt;990   &lt;/td&gt;&lt;td align="right"&gt;68&lt;/td&gt;&lt;td align="right"&gt;$124,163,973.00&lt;/td&gt;&lt;td style="white-space:nowrap;"&gt;23-1352298&lt;/td&gt;
      &lt;/tr&gt;&lt;tr style="color:#333333;background-color:White;"&gt;
          &lt;td&gt;&lt;a href="//990s.foundationcenter.org/990_pdf_archive/231/231352298/231352298_201602_990.pdf"&gt;Zoological Society of Philadelphia&lt;/a&gt;&lt;/td&gt;&lt;td&gt;PA&lt;/td&gt;&lt;td&gt;2016&lt;/td&gt;&lt;td&gt;990   &lt;/td&gt;&lt;td align="right"&gt;61&lt;/td&gt;&lt;td align="right"&gt;$125,008,026.00&lt;/td&gt;&lt;td style="white-space:nowrap;"&gt;23-1352298&lt;/td&gt;
      &lt;/tr&gt;&lt;tr style="color:#333333;background-color:#ECEEF2;"&gt;
          &lt;td&gt;&lt;a href="//990s.foundationcenter.org/990_pdf_archive/231/231352298/231352298_201502_990.pdf"&gt;Zoological Society of Philadelphia&lt;/a&gt;&lt;/td&gt;&lt;td&gt;PA&lt;/td&gt;&lt;td&gt;2015&lt;/td&gt;&lt;td&gt;990   &lt;/td&gt;&lt;td align="right"&gt;63&lt;/td&gt;&lt;td align="right"&gt;$131,880,929.00&lt;/td&gt;&lt;td style="white-space:nowrap;"&gt;23-1352298&lt;/td&gt;
      &lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>I am trying to scrape tr elements using style element</p>
  
  <pre><code>style="color:White;background-color:#045D99;font-weight:bold;"
  </code></pre>
  
  <p>Below is my code:</p>
  
  <pre><code>import requests
  from bs4 import BeautifulSoup
  data = requests.get(url).text
  soup = BeautifulSoup(data,"lxml")
  elems = soup.find_all('tr',style"color:White;background-color:#045D99;font-weight:bold;")
  </code></pre>
  
  <p>However my elems returns empty. Also in my soup element, i see that:</p>
  
  <pre><code>style="color:White;background-color:#045D99;font-weight:bold;"
  </code></pre>
  
  <p>has changed to </p>
  
  <pre><code>&lt;tr bgcolor="#ECEEF2"&gt;
  </code></pre>
  
  <p>I am not sure if this is causing the problem, also is there a way to scrape the whole tables as a pandas dataframe instead?</p>
  
  <p>Edit:</p>
  
  <p>I had a typo in my code, below is the correct code:</p>
  
  <pre><code>soup.find_all('tr',{"style":"color:White;background-color:#045D99;font-weight:bold;"})
  </code></pre>
  
  <p>Same as mentioned in the answers, still i get null results</p>
  
  <p>One more Edit:</p>
  
  <p>Even after the suggestions, i am still getting null results. The html is from below webpage:</p>
  
  <pre><code>http://990finder.foundationcenter.org/990results.aspx?990_type=&amp;fn=AMERICAN+HEART+ASSOCIATION&amp;st=&amp;zp=&amp;ei=&amp;fy=&amp;action=Search
  </code></pre>
  
  <p>I am trying to parse the table present in the webpage</p>