Class: HtmlParser

Inherits:
Object
  • Object
show all
Defined in:
lib/amazoned/client.rb

Class Method Summary collapse

Class Method Details

.parse(body, url, encoding) ⇒ Object



72
73
74
75
# File 'lib/amazoned/client.rb', line 72

def self.parse(body, url, encoding)
  body.encode!('UTF-8', encoding, invalid: :replace, undef: :replace, replace: '')
  Nokogiri::HTML::Document.parse(body, url, 'UTF-8')
end