On Wed, May 31, 2006 at 03:16:45AM +0900, Berger, Daniel wrote:
> I've gotten this far:
> 
> require 'mechanize'
> include WWW
> 
> mech  = Mechanize.new
> agent = mech.get(url)
> 
> page.links.each{ |link|
>    p link
> }

Try something like this:

require 'rubygems'
require 'mechanize'

agent = WWW::Mechanize.new
page = agent.get(ARGV[0])

bodies = []
page.links.each { |link|
  puts "Clicking '#{link.text}'"
  bodies << agent.click(link).body
}

p bodies

Or even shorter:

agent = WWW::Mechanize.new

bodies = []
agent.get(ARGV[0]).links.each { |link|
  bodies << agent.click(link).body
}

p bodies

--Aaron