I am fetching elements in the table:
<tbody id="actiontable-tbody">
<tr>
<td class="letterbreak first">default</td> <!-- first fetch this element -->
<td class="letterbreak">Internal</td>
<td class="action-btn-cell" id="id9c">
</tr>
<tr>
<td class="letterbreak first odd">opcua-module</td>
<td class="letterbreak odd">Internal</td>
<td class="action-btn-cell" id="id9d">
</td>
</tr>
</tbody>
I first fetch an element in one of the rows:
element = driver.find_element(By.XPATH,"//*[text()='default']")
Now I want to fetch the row containing that element. I tried:
row = element.parent
But that is returning a webDriver
object. How do I fetch the row with respect to the element in that row?
Edit: The ultimate goal is to then fetch the "action-btn-cell" element in that same row. So I was trying to go up a node and fetch the row node to then fetch the "action-btn-cell". Once I fetch the first element can I then fetch it's siblings? The fetch needs to be done starting with the first fetched element, either by going up to the row node or fetching the siblings, not by looping through all of the rows (it's a limitation by how the algorithm is implemented).