Sha256: 4e5d15d519982181c98f66428dfa368488d71f53c28a5b3c799d530ac1436649

Contents?: true

Size: 543 Bytes

Versions: 1

Compression:

Stored size: 543 Bytes

Contents

class Pizza
  include Scrapify::Base
  html "http://www.dominos.co.in/menuDetails_ajx.php?catgId=1"

  attribute :name, css: ".menu_lft li a"
  attribute :image_url, xpath: "//li//input//@value"
  attribute :price, css: ".price", regex: /([\d\.]+)/
  attribute :ingredients, css: ".ingredients", regex: /contains (\w+)/, array: true
  attribute :ingredient_urls, css: '.references ol li' do |element|
    element.children.map do |child|
        child.attributes['href'].value if child.attributes['href']
    end.compact
  end

  key :name
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
scrapify-0.0.6 spec/pizza.rb