Try the xpath:
//tr[.//a[contains(@href, 'xxx')]]
A couple of notes:
- It needs to be
.//a
instead of//a
(note the starting period). The period says to look anywhere within the current node (ie the tr). Without the period, it looks for the anchor to be present anywhere in the document. - The
contains
method is used to check if the href attribute includes the string.