Class Mechanize::Page
In: lib/mechanize/page.rb
Parent: Mechanize::File

This class encapsulates an HTML page. If Mechanize finds a content type of ‘text/html’, this class will be instantiated and returned.

Example:

  require 'mechanize'

  agent = Mechanize.new
  agent.get('http://google.com/').class # => Mechanize::Page

Methods

Classes and Modules

Class Mechanize::Page::Base
Class Mechanize::Page::Frame
Class Mechanize::Page::Image
Class Mechanize::Page::Label
Class Mechanize::Page::Link
Class Mechanize::Page::MetaRefresh

Constants

DEFAULT_RESPONSE = { 'content-type' => 'text/html', }.freeze

External Aliases

pretty_inspect -> inspect
search -> /
charset -> charset_from_content_type

Attributes

encodings  [R]  Possible encodings for this page based on HTTP headers and meta elements
mech  [RW] 

Public Class methods

Retrieves all charsets from meta tags in body

Retrieves the last content-type set by a meta tag in body

Public Instance methods

Return a list of all base tags

Return the canonical URI for the page if there is a link tag with href="canonical".

Get the content type

Return whether parser result has errors related to encoding or not. false indicates just parser has no encoding errors, not encoding is vaild.

Return a list of all form tags

Return a list of all frame tags

Return a list of all iframe tags

Return a list of all img tags

Return a list of all label tags

Return a list of all link and area tags

Return a list of all meta refresh elements

root()

Alias for parser

[Validate]