Sha256: ce82f06b09841bd263374eacaeb095bba1fef35da8a546f574841251a75edc61

Contents?: true

Size: 620 Bytes

Versions: 18

Compression:

Stored size: 620 Bytes

Contents

#coding: utf-8
require 'wombat'

class SampleCrawler
  include Wombat::Crawler

  base_url "http://www.obaoba.com.br"
  path "/porto-alegre/agenda"
  
  event_group "css=div.title-agenda", :iterator do
    event do |e|
      e.title("xpath=.") { |t| t.split(" | ")[1].strip }
      e.date "xpath=//div[@class='scrollable-items']/div[@class='s-item active']//a" do |d|
        DateTime.strptime(d, '%d/%m')
      end
      e.type("xpath=.type") { |t| t.split(" | ").first.strip.casecmp('SHOW') == 0 ? :show : :party }
    end

    venue do |v|
      v.name("xpath=.") { |n| name.split(" | ")[2].strip }
    end
   end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
wombat-3.0.0 spec/helpers/sample_crawler.rb
wombat-2.10.0 spec/helpers/sample_crawler.rb
wombat-2.9.0 spec/helpers/sample_crawler.rb
wombat-2.8.0 spec/helpers/sample_crawler.rb
wombat-2.7.0 spec/helpers/sample_crawler.rb
wombat-2.6.0 spec/helpers/sample_crawler.rb
wombat-2.5.1 spec/helpers/sample_crawler.rb
wombat-2.5.0 spec/helpers/sample_crawler.rb
wombat-2.4.0 spec/helpers/sample_crawler.rb
wombat-2.3.0 spec/helpers/sample_crawler.rb
wombat-2.2.1 spec/helpers/sample_crawler.rb
wombat-2.2.0 spec/helpers/sample_crawler.rb
wombat-2.1.3 spec/helpers/sample_crawler.rb
wombat-2.1.2 spec/helpers/sample_crawler.rb
wombat-2.1.1 spec/helpers/sample_crawler.rb
wombat-2.1.0 spec/helpers/sample_crawler.rb
wombat-2.0.1 spec/helpers/sample_crawler.rb
wombat-2.0.0 spec/helpers/sample_crawler.rb