I want to be able to extract all cells under a certain column with xpath.
There are/may be occasionally colspans.
Is there any way to do this, by which I suppose I’m asking, is there any inherent relationship between a table header and the cells below it? Or is there no inherent relationship and despite being fairly easy to do visually, its outside the ability of pure xpath?
Scenario:
We have an HTML table with a dozen columns and several rows. The columns have headers, and some of the column headers span more than one column.
One of those column headers (we don’t know which one) has the textual content “Pick Me”.
I want to be able to select all the cells under that cell in the table.
No, there is no association in xpath between column headers in a table and the column they fall within.
The only way to find cells that fall beneath a specific column header is, using some other code, to count the columns (account for colspans) until the desired table header is found, and then count that many columns in each row to extract the cells.