Class: Mechanize::RobotsDisallowedError

### Home Classes Methods

### In Files

- lib/mechanize/robots_disallowed_error.rb

### Parent

Mechanize::Error

### Methods

- ::new
- #inspect
- #to_s
- #uri

### Files

- EXAMPLES.rdoc
- GUIDE.rdoc
- LICENSE.rdoc
- Manifest.txt
- README.rdoc

### Class/Module Index

Quicksearch

- Mechanize
- Mechanize::ChunkedTerminationError
- Mechanize::ContentTypeError
- Mechanize::Cookie
- Mechanize::CookieCMethods
- Mechanize::CookieDeprecated
- Mechanize::CookieIMethods
- Mechanize::CookieJar
- Mechanize::CookieJarIMethods
- Mechanize::DirectorySaver
- Mechanize::Download
- Mechanize::ElementMatcher
- Mechanize::Error
- Mechanize::File
- Mechanize::FileConnection
- Mechanize::FileRequest
- Mechanize::FileResponse
- Mechanize::FileSaver
- Mechanize::Form
- Mechanize::Form::Button
- Mechanize::Form::CheckBox
- Mechanize::Form::Field
- Mechanize::Form::FileUpload
- Mechanize::Form::Hidden
- Mechanize::Form::ImageButton
- Mechanize::Form::Keygen
- Mechanize::Form::MultiSelectList
- Mechanize::Form::Option
- Mechanize::Form::RadioButton
- Mechanize::Form::Reset
- Mechanize::Form::SelectList
- Mechanize::Form::Submit
- Mechanize::Form::Text
- Mechanize::Form::Textarea
- Mechanize::HTTP
- Mechanize::HTTP::Agent
- Mechanize::HTTP::AuthChallenge
- Mechanize::HTTP::AuthRealm
- Mechanize::HTTP::AuthStore
- Mechanize::HTTP::ContentDispositionParser
- Mechanize::HTTP::WWWAuthenticateParser
- Mechanize::Headers
- Mechanize::History
- Mechanize::Image
- Mechanize::Page
- Mechanize::Page::Base
- Mechanize::Page::Frame
- Mechanize::Page::Image
- Mechanize::Page::Label
- Mechanize::Page::Link
- Mechanize::Page::MetaRefresh
- Mechanize::Parser
- Mechanize::PluggableParser
- Mechanize::Prependable
- Mechanize::RedirectLimitReachedError
- Mechanize::RedirectNotGetOrHeadError
- Mechanize::ResponseCodeError
- Mechanize::ResponseReadError
- Mechanize::RobotsDisallowedError
- Mechanize::TestCase
- Mechanize::UnauthorizedError
- Mechanize::UnsupportedSchemeError
- Mechanize::Util
- Mechanize::XmlFile
- HTTP
- HTTP::CookieJar

No matching classes.

# 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
    def initialize(url)
      if url.is_a?(URI)
        @url = url.to_s
        @uri = url
      else
        @url = url.to_s
      end
    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
    def to_s
      "Robots access is disallowed for URL: #{url}"
    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
    def uri
      @uri ||= URI.parse(url)
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.