Hello I have a parent element with the ID contacts that element has a child element that contains the text "hello" I would like to find that child element as a child of the element having the ID contacts. This is because "hello" occur on several places on the page but I only the want the "hello" that has contacts as parent.
Example of what I mean:
"//*[@id='contacts']/[contains(text(),'hello')]"
This does not work sadly
This should work! the easiest way to try this live, is in Chromes dev tools.
//*[@id='latest_block']//*[text()[contains(.,'hello')]]
Find out more how Xpath works here: