Class Nokogiri::HTML::Document
In: lib/nokogiri/ffi/html/document.rb
lib/nokogiri/html/document.rb
Parent: XML::Document

Methods

Public Class methods

Parse HTML. thing may be a String, or any object that responds to read and close such as an IO, or StringIO. url is resource where this document is located. encoding is the encoding that should be used when processing the document. options is a number that sets options in the parser, such as Nokogiri::XML::ParseOptions::RECOVER. See the constants in Nokogiri::XML::ParseOptions.

Public Instance methods

Get the meta tag encoding for this document. If there is no meta tag, then nil is returned

Set the meta tag encoding for this document. If there is no meta content tag, nil is returned and the encoding is not set.

Serialize Node using options. Save options can also be set using a block. See SaveOptions.

These two statements are equivalent:

 node.serialize(:encoding => 'UTF-8', :save_with => FORMAT | AS_XML)

or

  node.serialize(:encoding => 'UTF-8') do |config|
    config.format.as_xml
  end

[Validate]