Beautiful Soup and Tables
<p>Hi I'm trying to parse an html table using Beautiful Soup.
The table looks something like this: </p>

<pre><code>&lt;table width=100% border=1 cellpadding=0 cellspacing=0 bgcolor=#e0e0cc&gt;
 &lt;tr&gt;
  &lt;td width=12% height=1 align=center valign=middle  bgcolor=#e0e0cc bordercolorlight=#000000 bordercolordark=white&gt; &lt;b&gt;&lt;font face="Verdana" size=1&gt;&lt;a href="http://www.dailystocks.com/" alt="DailyStocks.com" title="Home"&gt;Home&lt;/a&gt;&lt;/font&gt;&lt;/b&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;/table&gt;
&lt;table width="100%" border="0" cellpadding="1" cellspacing="1"&gt;
  &lt;tr class="odd"&gt;&lt;td class="left"&gt;&lt;a href="whatever"&gt;ABX&lt;/a&gt;&lt;/td&gt;&lt;td class="left"&gt;Barrick Gold Corp.&lt;/td&gt;&lt;td&gt;55.95&lt;/td&gt;&lt;td&gt;55.18&lt;/td&gt;&lt;td class="up"&gt;+0.70&lt;/td&gt;&lt;td&gt;11040601&lt;/td&gt;&lt;td&gt;70.28%&lt;/td&gt;&lt;td&gt;&lt;center&gt;&amp;nbsp;&lt;a href="whatever" class="bcQLink"&gt;&amp;nbsp;Q&amp;nbsp;&lt;/a&gt;&amp;nbsp;&lt;a href="chart.asp?sym=ABX&amp;code=XDAILY" class="bcQLink"&gt;&amp;nbsp;C&amp;nbsp;&lt;/a&gt;&amp;nbsp;&lt;a href="texpert.asp?sym=ABX&amp;code=XDAILY" class="bcQLink"&gt;&amp;nbsp;O&amp;nbsp;&lt;/a&gt;&amp;nbsp;&lt;/center&gt;&lt;/td&gt;&lt;/tr&gt;
 &lt;/table&gt;
</code></pre>

<p>I would like to get the information from the second table, and so far I tried this code:</p>

<pre><code>html = file("whatever.html")
soup = BeautifulSoup(html)
t = soup.find(id='table')
dat = [ map(str, row.findAll("td")) for row in t.findAll("tr") ]
</code></pre>

<p>That doesnt seem to work, any help would be much appreciated,
Thanks</p>
