Mechanize::RobotsDisallowedError

Exception that is raised when an access to a resource is disallowed by robots.txt or by HTML document itself.

Attributes

url[R]

Returns the URL (string) of the resource that caused this error.

Public Class Methods

new(url) click to toggle source
    # File lib/mechanize/robots_disallowed_error.rb, line 5
 5:   def initialize(url)
 6:     if url.is_a?(URI)
 7:       @url = url.to_s
 8:       @uri = url
 9:     else
10:       @url = url.to_s
11:     end
12:   end

Public Instance Methods

inspect() click to toggle source
Alias for: to_s
to_s() click to toggle source
    # File lib/mechanize/robots_disallowed_error.rb, line 24
24:   def to_s
25:     "Robots access is disallowed for URL: #{url}"
26:   end
Also aliased as: inspect
uri() click to toggle source

Returns the URL (URI object) of the resource that caused this error. URI::InvalidURIError may be raised if the URL happens to be invalid or not understood by the URI library.

    # File lib/mechanize/robots_disallowed_error.rb, line 20
20:   def uri
21:     @uri ||= URI.parse(url)
22:   end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.