text1 link text2 |
Here's how it is (ignoring whitespace):
td.text == 'text1'
a.text == 'link'
a.tail == 'text2'
If you don't want a text that is inside child elements then you could collect only their tails:
text = td.text + ''.join([el.tail for el in td])