mechanize:Mechanize::Form::Option#unselect, #untick
以下のような HTML で
<html> <head> <title>form test</title> </head> <body> <form method="get" action="cgi/foo00.cgi" name="form1"> <select name="select1"> <option>1</option> <option>2</option> </select> <select name="select2" multiple> <option>foo</option> <option>bar</option> </select> </form> </body> </html>
>> require 'mechanize' => true >> agent = Mechanize.new => #<Mechanize:0xb74fa594 ... >> page = agent.get('http://127.0.0.1:8080/test20_select.html') => #<Mechanize::Page ... >> f = page.form('form1') => #<Mechanize::Form ... >> f.fields[0].options[0].selected => false >> f.fields[0].options[1].selected => false >> f.fields[0].options[0].select => true >> f.fields[0].options[0].selected => true >> f.fields[0].options[1].selected => false >> f.fields[0].options[0].unselect => false >> f.fields[0].options[0].selected => false >> f.fields[0].options[1].selected => false