Maybe mechanize does the trick too?
http://mechanize.rubyforge.org/