Reputation: 79
I try with my internet-bot to get infos from a table on a website. The table has just "map_table" as id (CSS attribute) tr has "map_tr" and for a cell it's "map_td".
I want to detect the cells with a link containing "msg.php" in their href. Ex :
<td id="map_td">
<a href="index.php"></a>
</td>
This one has not to be selected
<td id="map_td">
<a href="msg.php?id=1392"></a>
</td>
This one has to be selected. I have searched in the Mechanize doc, in forums, I haven't found anything. Can you help me ?
Upvotes: 0
Views: 481
Reputation: 55002
That should be:
page.search('td:has(a[href*="msg.php"])')
It's the Nokogiri docs that you want look at, but really, the CSS or XPath specs if you're not familiar with either of them.
Upvotes: 1