Assuming the following HTML source attached here with - Sample.html
NOTE:
1) All the "...." means there can be any number of TAG in between
2) All the reference A, B are merely reference. These will be duplicate entries so Xpath is not created based on that.
WHEN xPath = (//span[@class='node-type-button'])[1] , THEN results is First instance <span class=node-type-button> ...B...... </span> ===> PERFECT
Now, what is needed -
1) to go in the Reverse search order and find that particular parent of the above result having <div class="wrapper"> reference with A
/.. will not help, because the intended DIV is not just-the-previous item
How to find that ?