mechanize:Mechanize::Page#links

以下のような HTML で

<html>
<head>
<title>link test</title>
</head>
<body>

<a href="http://foo.org/" target="_blank">foo</a>
<a href="http://bar.org/">bar</a>

</body>
</html>
>> require 'mechanize'
=> true
>> agent = Mechanize.new
=> #<Mechanize:0xb7420380 ...
>> page = agent.get('http://127.0.0.1:8080/test06_link.html')
=> #<Mechanize::Page
 {url #<URI::HTTP:0xb741cac8 URL:http://127.0.0.1:8080/test06_link.html>}
 {meta}
 {title "link test"}
 {iframes}
 {frames}
 {links
  #<Mechanize::Page::Link "foo" "http://foo.org/">
  #<Mechanize::Page::Link "bar" "http://bar.org/">}
 {forms}>

>> page.links
=> [#<Mechanize::Page::Link "foo" "http://foo.org/">
, #<Mechanize::Page::Link "bar" "http://bar.org/">
]