I want to write something of the sort:
//a[not contains(@id, 'xx')]
(meaning all the links that there 'id' attribute doesn't contain the string 'xx')
I can't find the right syntax.
Format: != If the expression is not equal to the specified value, the operator returns true. If the expression is equal to the specified value, the operator returns false. Example: price!=
Using OR & AND This means that any one condition should be true to find the element. In the below XPath expression, it identifies the elements whose single or both conditions are true. Highlight both elements as 'First Name' element having attribute 'id' and 'Last Name' element having attribute 'name'.
XPath expressions can use comparison operators. Comparison operators compare one value to another. The resulting value is a "boolean" value.
not()
is a function in XPath (as opposed to an operator), so
//a[not(contains(@id, 'xx'))]
you can use not(expression)
function
or
expression != true()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With