You could use this XPath:
/table/tbody/tr/td[count(preceding-sibling::td)+1 = count(ancestor::table/thead/tr/th[.='Price']/preceding-sibling::th)+1]
I would think testing the position (position()
) of the td
against the position of the relevant th
would work, but it didn't seem to when I was testing.