title: Python Beautiful Soup parse a table with a specific ID
body: <p>I'm trying to get the data from a table with a specific ID which I know.
  For some reason, the code keeps giving me a None result.</p>
  
  <p>From the HTML code I'm trying to parse:</p>
  
  <pre><code>&lt;table cellspacing="0" cellpadding="3" border="0" id="ctl00_SPWebPartManager1_g_c001c0d9_0cb8_4b0f_b75a_7cc3b6f7d790_ctl00_HistoryData1_gridHistoryData_DataGrid1" style="width:100%;border-collapse:collapse;"&gt;
      &lt;tr class="gridHeader" valign="top"&gt;
          &lt;td class="titleGridRegNoB" align="center" valign="top"&gt;&lt;span dir=RTL&gt;שווי שוק (אלפי ש"ח)&lt;/span&gt;&lt;/td&gt;
          &lt;td class="titleGridReg" align="center" valign="top"&gt;הון רשום למסחר&lt;/td&gt;
          &lt;td class="titleGridReg" align="center" valign="top"&gt;שער נמוך&lt;/td&gt;&lt;td class="titleGridReg" align="center" valign="top"&gt;שער גבוה&lt;/td&gt;
          &lt;td class="titleGridReg" align="center" valign="top"&gt;שער בסיס&lt;/td&gt;
          &lt;td class="titleGridReg" align="center" valign="top"&gt;שער פתיחה&lt;/td&gt;&lt;td class="titleGridReg" align="center" valign="top"&gt;&lt;span dir="rtl"&gt;שער נעילה (באגורות)&lt;/span&gt;&lt;/td&gt;
          &lt;td class="titleGridReg" align="center" valign="top"&gt;שער נעילה מתואם&lt;/td&gt;&lt;td class="titleGridReg" align="center" valign="top"&gt;תאריך&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr onmouseover="this.style.backgroundColor='#FDF1D7'" onmouseout="this.style.backgroundColor='#ffffff'"&gt;
  </code></pre>
  
  <p>... And so on</p>
  
  <p>My code:</p>
  
  <pre><code>html = br.response().read()
  soup = BeautifulSoup(html)
  
  table = soup.find(lambda tag: tag.name=='table' and tag.has_key('id') and tag['id']=="ctl00_SPWebPartManager1_g_c001c0d9_0cb8_4b0f_b75a_7cc3b6f7d790_ctl00_HistoryData1_gridHistoryData_DataGrid1")
  rows = table.findAll(lambda tag: tag.name=='tr')
  
  In [100]: print table
  None
  </code></pre>