lib/anemone/page.rb
#
# Array of distinct A tag HREFs from the page
#
Array of distinct A tag HREFs from the page
Array of distinct A tag HREFs from the page
def links
      return @page_links if @page_links
      @page_links = []
      return @page_links if !doc
      doc.search("//a[@href]").each do |a|
        u = a['href']
        next if u.nil? or u.empty?
        abs = to_absolute(u) rescue next
        @page_links << abs if in_domain?(abs)
      end
      @page_links.uniq!
      self.connected_links = @page_links.map(&:to_s)
    end
def links return @page_links if @page_links @page_links = [ ] return @page_links if ! doc doc . search ( "//a[@href]" ) . each do | a | u = a [ 'href' ] next if u . nil? or u . empty? abs = to_absolute ( u ) rescue next @page_links << abs if in_domain? ( abs ) end @page_links . uniq! self . connected_links = @page_links . map ( & :to_s ) end
Array of distinct A tag HREFs from the page
Array of distinct A tag HREFs from the page