I want to get an td element without attributes.
For example: My code:
<td class="yyy">1234</td>
<td>5678</td>
I want to get: 5678
What the XPath for that?
Thank, Chani
I think this is a duplicate of several other SO questions:
See this:
XPath: How to select nodes which have no attributes?
Which recommends:
//node[not(@*)]
Where node is your nodename.
try the following
/td[not(@class)]
how about
.//td[. = '5678']
or
.//td[text() = '5678']
--
if it is important that there are no attributes then,
.//td[text() = '5678' and not(@*)]
--
or, if you want to get the inner text of the first td
with no attributes.
.//td[not(@*)][1]/text()