Method: Spidr::Page#each_url

Defined in:
lib/spidr/page/html.rb

#each_url {|url| ... } ⇒ Enumerator Also known as: each

Enumerates over every absolute URL in the page.

Yields:

  • (url)

    The given block will be passed every URL in the page.

Yield Parameters:

  • url (URI::HTTP)

    An absolute URL in the page.

Returns:

  • (Enumerator)

    If no block is given, an enumerator object will be returned.

Since:

  • 0.3.0


236
237
238
239
240
241
242
243
244
# File 'lib/spidr/page/html.rb', line 236

def each_url
  return enum_for(__method__) unless block_given?

  each_link do |link|
    if (url = to_absolute(link))
      yield url
    end
  end
end