How can I get values from table?

How can I get values from table td irrelevant to elements inside?

For example
i have

<td>
<b>ABC</b>
<span>def</span>
</td>

Then how to get ABC def as complete text or into list as [‘ABC’, ‘def’]?

Note the reason I need this way is because I don’t know which elements are present inside td, There might b more than 2 or only 1 also.

If you know with which character the values are separated inside the cell, you can save to a String and then split it in a List.
split.zip (6.3 KB)