Sha256: 722ef63573be6d070f31bd95a82835749424529fbd164bfedfd8902fcd423ba9

Contents?: true

Size: 702 Bytes

Versions: 7

Compression:

Stored size: 702 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)
      nil
    end

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

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

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
akephalos-0.2.3-java lib/akephalos/page.rb
akephalos-0.2.3 lib/akephalos/page.rb
akephalos-0.2.2-java lib/akephalos/page.rb
akephalos-0.2.2 lib/akephalos/page.rb
akephalos-0.2.1 lib/akephalos/page.rb
akephalos-0.2.0 lib/akephalos/page.rb
akephalos-0.2.0-java lib/akephalos/page.rb