Class: LCBO::StoreListPage

Inherits:
Object
  • Object
show all
Includes:
CrawlKit::Page
Defined in:
lib/lcbo/pages/store_list_page.rb

Constant Summary collapse

STORE_COUNT_RANGE =
595..630

Instance Method Summary collapse

Methods included from CrawlKit::Page

#[], #as_hash, #fields, #http_method, included, #initialize, #is_parsed?, #parse, #process, #request, #request_prototype

Instance Method Details

#anchorsObject


39
40
41
# File 'lib/lcbo/pages/store_list_page.rb', line 39

def anchors
  doc.css('.store-location-list td[width="14%"] a.item-details-col0')
end

#verify_number_of_storesObject


43
44
45
46
47
# File 'lib/lcbo/pages/store_list_page.rb', line 43

def verify_number_of_stores
  return if STORE_COUNT_RANGE.include?(store_ids.length)
  raise CrawlKit::MalformedError,
    "Store count (#{store_ids.length}) not in range: #{STORE_COUNT_RANGE}"
end