XPath to find elements with attributes

Posted by priyank.mp on Stack Overflow See other posts from Stack Overflow or by priyank.mp
Published on 2010-03-12T18:58:07Z Indexed on 2010/03/12 19:07 UTC
Read the original article Hit count: 186

Filed under:

How can I find elements that has at least one attribute?

Example:

<tr>...</tr>
<tr style="">...</tr>
<tr width="">...</tr>

I want all tr elements but ...

I tried following xpath but it doesn't work.

//table//tr[contains(attributes::*,'')]

Thanks

© Stack Overflow or respective owner

Related posts about xpath