An image element on an HTML page
Creates a new Mechanize::Page::Image from an image node and source page.
The alt attribute of the image
The caption of the image. In order of preference, the title, alt, or empty string "".
The class attribute of the image
The id attribute of the image
The suffix of the url. The dot is a part of suffix, not a delimiter.
p image.url # => "http://example/test.jpg" p image.extname # => ".jpg"
Returns an empty string if url has no suffix:
p image.url # => "http://example/sampleimage" p image.extname # => ""
Downloads the image.
agent.page.image_with(:src => /logo/).fetch.save
The referer is:
The height attribute of the image
MIME type guessed from the image url suffix
p image.extname # => ".jpg" p image.mime_type # => "image/jpeg" page.images_with(:mime_type => /gif|jpeg|png/).each do ...
Returns nil if url has no (well-known) suffix:
p image.url # => "http://example/sampleimage" p image.mime_type # => nil
The src attribute of the image
Alias for caption
The title attribute of the image
The URL string of this image
URI for this image
The width attribute of the image
[Validate]