My goal is to retrieve an element from a list by clicking on a link containing specific text. Here is the HTML code snippet:
<table>
<td>
<tr><a href='...'>I need help</a></tr>
<tr><a href='...'>Oh hello</a></tr>
<tr><a href='...'>Lorem ipsum</a></tr>
</td>
</table>
I attempted to achieve this by using the following code:
.click('table > td > tr > a:contains("I need help")')
Unfortunately, this approach did not work as expected.
I cannot resort to this alternative method:
.click('table > td > tr:nth-child(1) > a)
due to the likelihood of additional tr tags being added to the site over time.
Any suggestions on how to solve this issue?