XPath.
(//a[@href = "http://exact url"])[1]/ancestor::table[1]
table a XML, href - "http://exact url".
This provides the correct element table, even if nested tables , each of which has the desired element aas a descendant. In this case, the aforementioned XPath expression selects the innermost one table- unlike the currently accepted answer, which receives the outermost ancestor table.
source
share