mechanize:Mechanize::Form::ImageButton#x, #y
以下のような HTML で
<html> <head> <title>form test</title> </head> <body> <form method="get" action="cgi/foo00.cgi" name="form1"> <input type="image" src="foo1.png" name="image1" /> <input type="image" src="foo2.png" name="image2" /> </form> </body> </html>
>> require 'mechanize' => true >> agent = Mechanize.new => #<Mechanize:0xb74c45ac ... >> page = agent.get('http://127.0.0.1:8080/test19_form.html') => #<Mechanize::Page ... >> f = page.form('form1') => #<Mechanize::Form ... >> f.buttons => [#<Mechanize::Form::ImageButton:0xb74b8194 @name="image1", @y=nil, @x=nil, @value=nil, @node=#<Nokogiri::XML::Element:0x..fdba5c174 name="input" attributes=[#<Nokogiri::XML::Attr:0x..fdba5a5e0 name="type" value="image">, #<Nokogiri::XML::Attr:0x..fdba5a5d6 name="src" value="foo1.png">, #<Nokogiri::XML::Attr:0x..fdba5a5cc name="name" value="image1">]>>, #<Mechanize::Form::ImageButton:0xb74b7ff0 @name="image2", @y=nil, @x=nil, @value=nil, @node=#<Nokogiri::XML::Element:0x..fdba5c124 name="input" attributes=[#<Nokogiri::XML::Attr:0x..fdba5897a name="type" value="image">, #<Nokogiri::XML::Attr:0x..fdba58970 name="src" value="foo2.png">, #<Nokogiri::XML::Attr:0x..fdba58966 name="name" value="image2">]>>] >> f.buttons.size => 2 >> f.buttons[0].x => nil >> f.buttons[0].y => nil
設定・活用されるタイミングってあるのか???