mechanize:Mechanize::Form#form_node
以下のような HTML で
<html> <head> <title>form test</title> </head> <body> <form method="get" action="cgi/foo00.cgi" name="form1"> </form> <form method="post" action="cgi/foo01.cgi" name="form2"> </form> </body> </html>
>> require 'mechanize' => true >> agent = Mechanize.new => #<Mechanize:0xb746b538 ... >> page = agent.get('http://127.0.0.1:8080/test09_form.html') => #<Mechanize::Page {url #<URI::HTTP:0xb7467c80 URL:http://127.0.0.1:8080/test09_form.html>} {meta} {title "form test"} {iframes} {frames} {links} {forms #<Mechanize::Form {name "form1"} {method "GET"} {action "cgi/foo00.cgi"} {fields} {radiobuttons} {checkboxes} {file_uploads} {buttons}> #<Mechanize::Form {name "form2"} {method "POST"} {action "cgi/foo01.cgi"} {fields} {radiobuttons} {checkboxes} {file_uploads} {buttons}>}> >> page.form_with(:name => "form1").form_node => #<Nokogiri::XML::Element:0x..fdba2fe26 name="form" attributes=[#<Nokogiri::XML::Attr:0x..fdba2c55a name="method" value="get">, #<Nokogiri::XML::Attr:0x..fdba2c550 name="action" value="cgi/foo00.cgi">, #<Nokogiri::XML::Attr:0x..fdba2c546 name="name" value="form1">] children=[#<Nokogiri::XML::Text:0x..fdba2c15e "\n">]>