mechanize:Mechanize::Page::Link#click
以下のような HTML で
<html> <head> <title>link test</title> </head> <body> <a href="http://www.yahoo.co.jp/">Yahoo!</a> <a href="http://www.google.co.jp/">Google</a> </body> </html>
>> require 'mechanize' => true >> agent = Mechanize.new => #<Mechanize:0xb741d360 .. >> page = agent.get('http://127.0.0.1:8080/test08_link.html') => #<Mechanize::Page {url #<URI::HTTP:0xb7419aa8 URL:http://127.0.0.1:8080/test08_link.html>} {meta} {title "link test"} {iframes} {frames} {links #<Mechanize::Page::Link "Yahoo!" "http://www.yahoo.co.jp/"> #<Mechanize::Page::Link "Google" "http://www.google.co.jp/">} {forms}> >> page.link_with(:href => //).uri => #<URI::HTTP:0xb740e978 URL:http://www.yahoo.co.jp/> >> page2 = page.link_with(:href => //).click => #<Mechanize::Page {url #<URI::HTTP:0xb740b570 URL:http://www.yahoo.co.jp/>} ...