I’m trying to add a condition to a node’s parent, and I can’t get it to work.
I only want the nodes having a certain class, but also for which the parent has also a certain class, like :
//*[@class='price' and parent@class='special-price']
Does someone have an idea on how to add conditions on parents too ?
Thanks
Use
//*p[@class = 'special-price']/*[@class = 'price']or//*[@class = 'price' and ../@class = 'special-price'].