Class Mechanize::Page::Link
In: lib/mechanize/page/link.rb
lib/mechanize/monkey_patch.rb
Parent: Object

This class encapsulates links. It contains the text and the URI for ‘a’ tags parsed out of an HTML page. If the link contains an image, the alt text will be used for that image.

For example, the text for the following links with both be ‘Hello World’:

<a href="Hello">rubyforge.org">Hello World</a> <a href="rubyforge.org"> src="test.jpg" alt="Hello World"></a>

Methods

click   dom_id   new   uri  

External Aliases

text -> to_s
page -> referer
pretty_inspect -> inspect

Attributes

attributes  [R] 
href  [R] 
node  [R] 
page  [R] 
text  [R] 

Public Class methods

Public Instance methods

Click on this link

This method is a shorthand to get link‘s DOM id. Common usage: page.link_with(:dom_id => "links_exact_id")

[Validate]