class Nokogiri::HTML4::SAX::Parser


Also see Nokogiri::XML::SAX::Document for the available events.
Nokogiri::XML::SAX::Parser.
For more information on SAX parsers, see Nokogiri::XML::SAX or the parent class
end
parser.parse(f)
File.open(path_to_html) do |f|
# Hand an IO object to the parser, which will read the HTML from the IO.
parser = Nokogiri::HTML4::SAX::Parser.new(MyHandler.new)
end
end
puts “found a #{name}”
def start_element name, attributes = []
class MyHandler < Nokogiri::XML::SAX::Document
Here is a basic usage example:
⚠ This is an HTML4 parser and so may not support some HTML5 features and behaviors.
messages to the Nokogiri::XML::SAX::Document.
takes a Nokogiri::XML::SAX::Document, an optional encoding, then given an HTML input, sends
This parser is a SAX style parser that reads its input as it deems necessary. The parser
##