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