Sha256: 607db239fed2f657e2aa96dfe374ac5073bb7b62ce44835aeae645c7d225c0c7

Contents?: true

Size: 474 Bytes

Versions: 5

Compression:

Stored size: 474 Bytes

Contents

# frozen_string_literal: true

require_relative 'base'

module Aranha
  module Parsers
    module Html
      class Item < Base
        def data
          @data ||= node_parser.parse(item_node)
        end

        def item_node
          @item_node ||= begin
            r = item_xpath ? nokogiri.at_xpath(item_xpath) : nokogiri
            raise "Item node not found (Item xpath: #{item_xpath})" unless r
            r
          end
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
aranha-0.9.0 lib/aranha/parsers/html/item.rb
aranha-0.8.0 lib/aranha/parsers/html/item.rb
aranha-0.7.1 lib/aranha/parsers/html/item.rb
aranha-0.7.0 lib/aranha/parsers/html/item.rb
aranha-0.6.0 lib/aranha/parsers/html/item.rb