XPath: Does Not Start With
Combining the starts-with() function with not() allows you to exclude elements whose attribute values or text content begin with a specific substring.
You can use the following XPath:
Example 1: //ul[@class='list-group']/li[not(starts-with(@class,'border-danger'))]
Example 2: //ul[@class='list-group']/li[not(starts-with(@id,'border-danger'))]
- New Item
- Sample Item 0001
- Sample Item 0002
- Sample Item 0003
- Sample Item 0004
- Sample Item 0005
- Sample Item 0006
- Sample Item 0007
- Sample Item 0008
- Sample Item 0009
- Sample Item 0010