Find <td> tag value with specific text (Beautiful Soup)
<p>I need to extract data structured in a table from an HTML page. The data structure is all like this:</p>

<pre><code>&lt;td class="def"&gt;
            &lt;div&gt;&lt;b&gt;First Name:&lt;/b&gt;&lt;/div&gt;
        &lt;/td&gt;
        &lt;td class="def"&gt;Jhon
        &lt;/td&gt;

&lt;td class="def"&gt;
            &lt;div&gt;&lt;b&gt;Last Name:&lt;/b&gt;&lt;/div&gt;
        &lt;/td&gt;
        &lt;td class="def"&gt;Smith
        &lt;/td&gt;
</code></pre>

<p>I need to extract data separately. For example</p>

<pre><code>print first_name
&gt;&gt; Jhon
print last_name
&gt;&gt; Smith
</code></pre>

<p>A simple <code>soup.find('td', {'class':'def'})</code> won't work because it will match everything (First Name:, Jhon, Last Name:, Smith). </p>

<p>Any idea on how I can look for specific data? The same question was posted <a href="https://stackoverflow.com/questions/9007653/how-to-find-tag-with-particular-text-with-beautiful-soup">here</a> but the solution given doesn't work at all...</p>