Python Beautiful Soup - find value based on text in HTML
<p>I am having a problem finding a value in a soup based on text.  Here is the code</p>

<pre><code>from bs4 import BeautifulSoup as bs
import requests
import re

html='http://finance.yahoo.com/q/ks?s=aapl+Key+Statistics'
r = requests.get(html)
soup = bs(r.text)
findit=soup.find("td", text=re.compile('Market Cap'))
</code></pre>

<p>This returns [], yet there absolutely is text in a 'td' tag with 'Market Cap'.
When I use</p>

<pre><code>soup.find_all("td")
</code></pre>

<p>I get a result set which includes:</p>

<pre><code>&lt;td class="yfnc_tablehead1" width="74%"&gt;Market Cap (intraday)&lt;font size="-1"&gt;&lt;sup&gt;5&lt;/sup&gt;&lt;/font&gt;:&lt;/td&gt;
</code></pre>