Extracting every <td>
from an HTML document is easy, but it's not a foolproof way to navigate the DOM. However, given the limitations of the sample HTML, here's a solution. I doubt it'll work in a real-world situation though.
Mechanize uses Nokogiri internally for its heavy lifting so doing require 'nokogiri'
isn't necessary if you've already required Mechanize.
require 'nokogiri'
doc = Nokogiri::HTML::DocumentFragment.parse(<<EOT)
<td> <A HREF="http://www.edu/st/file.html">alo</A> </td>
<td> <A HREF="http://www.dom/st/file.html">foo</A> </td>
<td> bla bla </td>
EOT
doc.search('td')[-3].at('a')['href']
=> "http://www.edu/st/file.html"
How to get the Nokogiri document from the Mechanize "agent" is left as an exercise for the user.