Sha256: d5b07d75634138df60a3ff63a5ce0890f3eccbc45be95066eefca5f51c3dbf0f

Contents?: true

Size: 941 Bytes

Versions: 1

Compression:

Stored size: 941 Bytes

Contents

=begin
                  Arachni
  Copyright (c) 2010-2011 Tasos "Zapotek" Laskos <tasos.laskos@gmail.com>

  This is free software; you can copy and distribute and modify
  this program under the term of the GPL v2.0 License
  (See LICENSE file for details)

=end

module Arachni::Parser::Extractors

#
# Extracts paths from "script" HTML elements.<br/>
# Both from "src" and the text inside the scripts.
#
# @author: Tasos "Zapotek" Laskos
#                                      <tasos.laskos@gmail.com>
#                                      <zapotek@segfault.gr>
# @version: 0.1
#
class Scripts < Paths

    #
    # Returns an array of paths as plain strings
    #
    # @param    [Nokogiri]  Nokogiri document
    #
    # @return   [Array<String>]  paths
    #
    def run( doc )
        doc.search( "//script[@src]" ).map { |a| a['src'] } |
        doc.search( "//script" ).map { |script| URI.extract( script.to_s ) }
    end

end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
arachni-0.3 path_extractors/scripts.rb