How to write a code that will click links on a webpage with specified conditions:
The script should look into each div.table-row and check if list element (div.domains ul li) in the div contains certain string (somedomain.com), and click the link a.delete link inside which is in div.actions inside div.table-row.
Heres the HTML structure:
<div class="table-row">
<div class="domains">
<ul>
<li>somedomain.com</li
<li>someotherdomain.com</li>
</ul>
</div>
<div class="actions">
<ul class="menu">
<li><a class="delete">Delete</a></li>
</div>
</div>
How to write this code in ruby mechanize?
I have no idea how to select all .table-rows and loop through them to click delete links if condition is met?
Thanks for help