class Nokorexi
Attributes
to_doc[R]
to_s[R]
Public Class Methods
new(x, noscript: true, debug: false)
click to toggle source
# File lib/nokorexi.rb, line 14 def initialize(x, noscript: true, debug: false) raws = RXFHelper.read(x).first s = raws[/.*<\/html>$/m] || raws puts 's: ' + s.inspect if debug raw_doc = Nokogiri::HTML(s.gsub(" ",' ')) raw_doc.xpath('//script').each(&:remove) if noscript @to_s = xml = raw_doc.xpath('html').to_xml @to_doc = Rexle.new(xml, debug: debug) end