Class: Aranha::Parsers::Html::Item
- Defined in:
- lib/aranha/parsers/html/item.rb
Constant Summary
Constants inherited from Base
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
field, fields, from_node, #nokogiri, xpath_contains_class, xpath_ends_with
Methods inherited from Base
#content, #content_encoding, from_content, from_string, #initialize, #source_address_content
Constructor Details
This class inherits a constructor from Aranha::Parsers::Base
Instance Method Details
#data ⇒ Object
9 10 11 |
# File 'lib/aranha/parsers/html/item.rb', line 9 def data @data ||= node_parser.parse(item_node) end |
#item_node ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/aranha/parsers/html/item.rb', line 13 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 |