I have two XPath, for example:
/ html / body / div [3] / div [4] / table / tbody / tr [2] / td [4] and
/ html / body / div [3] / div [4] / table / tbody / tr [2] / td [3] / a [2]
How can I find the first common ancestor now? In this case, it will be /html/body/div[3]/div[4]/table/tbody/tr[2]/ .
I found this question , but the solution is in ruby ββand actually does not let me understand how to do this in Javascript. Can anybody help me? Thanks.
source share