I'm using Selenium with xpath to get certain elements. I have a html page with the following elements:
<td>A</td>
<td><em>B</em></td>
I've tried using the following xpath expression to find td elements:
//td[contains(text(), 'A')]
//td[contains(text(), 'B')]
The expression finds <td>A</td>
but not <td><em>B</em></td>
How can I write an xpath expression which finds td tags with both no sub element and one or more sub elements?