//*
//li
//*[@class]
class
attribute
//*[@class='target']
class=target
attribute
//*[contains(@class, 'target')]
class="demo target"
attribute
//*[contains(text(),'item')]
//*[starts-with(name(), 'custom-')]
//*[@*[starts-with(name(), 'data-custom-')]]
data-custom-1
attribute
data-custom-2
attribute
//parent::*
class
attribute
//preceding-sibling::*
class
//preceding-sibling::*[1]
class
attribute
//following-sibling::*
class
attribute
//following-sibling::*[1]
class
attribute
//*[*[3]]
//*[@data-price >= 5]
data-price=1
attribute
data-price=3
attribute
data-price=5
attribute
data-price=7
attribute
data-price=9
attribute
//*[substring-after(name(), "h") > 0]
//li[strong]
//*[not(following-sibling::*[1])]
We should see ONLY the following elements selected:
p span