Sha256: 01294cd5f8376451d56ebca98a4a7750eeb18f07d1cdbea018b4124ad5785efe

Contents?: true

Size: 612 Bytes

Versions: 6

Compression:

Stored size: 612 Bytes

Contents

module Akephalos
  class Page
    def initialize(page)
      @nodes = []
      @_page = page
    end

    def find(selector)
      nodes = @_page.getByXPath(selector).map { |node| Node.new(node) }
      @nodes << nodes
      nodes
    end

    def modified_source
      @_page.asXml
    end

    def source
      @_page.getWebResponse.getContentAsString
    end

    def current_url
      @_page.getWebResponse.getRequestSettings.getUrl.toString
    end

    def execute_script(script)
      @_page.executeJavaScript(script).getJavaScriptResult
    end

    def ==(other)
      @_page == other
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
akephalos-0.1.0-java lib/akephalos/page.rb
akephalos-0.1.0 lib/akephalos/page.rb
akephalos-0.0.5 lib/akephalos/page.rb
akephalos-0.0.4 lib/akephalos/page.rb
akephalos-0.0.3 lib/akephalos/page.rb
akephalos-0.0.2 lib/akephalos/page.rb