G
GinTon
I'm trying to get the 'FOO' string but the problem is that inner 'P'
tag there is another tag, 'a'. So:
So if I run 'print tree.first('p').string' to get the 'FOO' string it
shows Null value because it's the 'a' tag:
Any solution?
tag there is another tag, 'a'. So:
from BeautifulSoup import BeautifulSoup
s = '<td width="88%" valign="TOP"> <p class="contentBody">FOO <a name="f"></a> </p></td>'
tree = BeautifulSoup(s)
<p class="contentBody">FOO <a name="f"></a> </p>print tree.first('p')
So if I run 'print tree.first('p').string' to get the 'FOO' string it
shows Null value because it's the 'a' tag:
Nullprint tree.first('p').string
Any solution?