I'd like to extract the text from between the tags with beautiful soup. So far I have:
def table_to_text(html):
from bs4 import BeautifulSoup
soup = BeautifulSoup(html)
trs = soup.findAll('tr')
for tr in trs:
print 'row '
print tr.findAll(['td','th']).text
This gives me output that looks like:
row
[<td> AAA </td>, <td>Chi</td>, <td></td>, <td class="center"><span class="blue">1353</span>/<span class="red">23</span></td>]/n
I'd like to get the output to look like:
[ AAA , Chi, , 1353, 23]
How can I do this?