module SpiderCore::PaginationDSL

Attributes

next_page[RW]
skip_pages[RW]

Public Instance Methods

keep_eyes_on_next_page(pattern, attr: :href) { |element| ... } click to toggle source
# File lib/spider_core/pagination_dsl.rb, line 6
def keep_eyes_on_next_page(pattern, attr: :href, &block)
  actions << lambda {
    element = first(pattern)
    path = block_given? ? yield(element) : element && element[:href]
    @paths.unshift(path) if path
  }
end