mechanize:Mechanize::Page::Image#url
以下のような HTML で
<html> <head> <title>image test</title> </head> <body> <img src="img1.png" width="256" height="128" alt="foo"> <img src="img2.png" width="200" height="100" alt="bar"> </body> </html>
>> require 'mechanize' => true >> agent = Mechanize.new => #<Mechanize:0xb74d0604 ... >> page = agent.get('http://127.0.0.1:8080/test04_image.html') => #<Mechanize::Page {url #<URI::HTTP:0xb74ccce8 URL:http://127.0.0.1:8080/test04_image.html>} {meta} {title "image test"} {iframes} {frames} {links} {forms}> >> page.images[0] => #<Mechanize::Page::Image:0xb74c32b0 @page=#<Mechanize::Page {url #<URI::HTTP:0xb74ccce8 URL:http://127.0.0.1:8080/test04_image.html>} {meta} {title "image test"} {iframes} {frames} {links} {forms}> , @node=#<Nokogiri::XML::Element:0x..fdba61980 name="img" attributes=[#<Nokogiri::XML::Attr:0x..fdba610ac name="src" value="img1.png">, #<Nokogiri::XML::Attr:0x..fdba610a2 name="width" value="256">, #<Nokogiri::XML::Attr:0x..fdba61098 name="height" value="128">, #<Nokogiri::XML::Attr:0x..fdba6108e name="alt" value="foo">]>> >> page.images[0].url => "http://127.0.0.1:8080/img1.png"