I want to write something of the sort:
//a[not contains(@id, \'xx\')]
(meaning all the links that there \'id\' attribute doesn\'t contain t
None of these answers worked for me for python. I solved by this
a[not(@id='XX')]
Also you can use or condition in your xpath by | operator. Such as
|
a[not(@id='XX')]|a[not(@class='YY')]
Sometimes we want element which has no class. So you can do like
a[not(@class)]