title: Getting style attribute using BeautifulSoup
body: <p>I'm scraping a page and from a table on that page I'm getting all <code>&lt;tr&gt;</code> elements like so:</p>
  
  <pre><code>r = requests.get("http://lol.esportswikis.com/wiki/G2_Esports/Match_History")
  s = BeautifulSoup(r.content, "lxml")
  tr = s.find_all("table", class_="wikitable sortable")[0].find_all("tr")[3:]
  
  print tr[0]
  </code></pre>
  
  <p>which outputs:</p>
  
  <pre><code>&lt;tr style="background-color:#C6EFCE"&gt;&lt;td&gt;...&lt;/td&gt; ... &lt;td&gt;...&lt;/td&gt;&lt;/tr&gt;
  </code></pre>
  
  <p>Now I'm trying to get the style of the <code>&lt;tr&gt;</code> tag, but I have no idea how. If I do this for example:</p>
  
  <pre><code>for item in tr[0]:
      print item
  </code></pre>
  
  <p>it obviously just prints the <code>&lt;td&gt; ... &lt;/td&gt;</code> stuff. I'm thinking I can probably do something like <code>print tr[0].something</code>, like <code>tr[0].tag</code>, but everything I've tried so far hasn't resulted in what I want.</p>