Class: Nokogiri::HTML::SAX::Parser
- Inherits:
-
XML::SAX::Parser
- Object
- XML::SAX::Parser
- Nokogiri::HTML::SAX::Parser
- Defined in:
- lib/nokogiri/html/sax/parser.rb
Instance Attribute Summary
Attributes inherited from XML::SAX::Parser
Instance Method Summary collapse
-
#parse_file(filename, encoding = 'UTF-8') ⇒ Object
Parse a file with
filename
. -
#parse_memory(data, encoding = 'UTF-8') ⇒ Object
Parse html stored in
data
usingencoding
.
Methods inherited from XML::SAX::Parser
#initialize, #parse, #parse_io
Constructor Details
This class inherits a constructor from Nokogiri::XML::SAX::Parser
Instance Method Details
#parse_file(filename, encoding = 'UTF-8') ⇒ Object
Parse a file with filename
13 14 15 16 17 |
# File 'lib/nokogiri/html/sax/parser.rb', line 13 def parse_file filename, encoding = 'UTF-8' raise Errno::ENOENT unless File.exists?(filename) raise Errno::EISDIR if File.directory?(filename) native_parse_file filename, encoding end |
#parse_memory(data, encoding = 'UTF-8') ⇒ Object
Parse html stored in data
using encoding
7 8 9 |
# File 'lib/nokogiri/html/sax/parser.rb', line 7 def parse_memory data, encoding = 'UTF-8' native_parse_memory(data, encoding) end |