Sha256: b4dc98d2139751261cec3cfa8dde0fb55776a4a8608a30644f68014665b8a6be
Contents?: true
Size: 691 Bytes
Versions: 75
Compression:
Stored size: 691 Bytes
Contents
# frozen_string_literal: true require 'aranha/parsers/html/base' module Aranha module Parsers module Html class ItemList < Base def data items_data end def item_data(item) item end def items_data count = 0 @data ||= nokogiri.xpath(items_xpath).map do |m| count += 1 item_data(node_parser.parse(m)) end rescue StandardError => e raise StandardError, "#{e.message} (Count: #{count})" end def items_xpath raise "Class #{self.class} has no method \"#{__method__}\". Implement it" end end end end end
Version data entries
75 entries across 75 versions & 2 rubygems