Sha256: fdecfd2e66a148eb04017f824c3003d933574035b1b66e9cae0642465c8a65fa

Contents?: true

Size: 814 Bytes

Versions: 19

Compression:

Stored size: 814 Bytes

Contents

module Webdrone
  class Browser
    def html
      @html ||= Html.new self
    end
  end

  class Html
    attr_accessor :a0

    def initialize(a0)
      @a0 = a0
    end

    def find_html(text, n: 1, all: false, visible: true)
      item = @a0.find.send __callee__, text, n: n, all: all, visible: visible
      if item.is_a? Array
        item.collect { |x| x.attribute 'innerHTML'}
      else
        item.attribute 'innerHTML'
      end
    rescue => exception
      Webdrone.report_error(@a0, exception)
    end

    alias_method :id,     :find_html
    alias_method :css,    :find_html
    alias_method :link,   :find_html
    alias_method :button, :find_html
    alias_method :on,     :find_html
    alias_method :option, :find_html
    alias_method :xpath,  :find_html

    protected :find_html
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
webdrone-1.6.2 lib/webdrone/html.rb
webdrone-1.6.0 lib/webdrone/html.rb
webdrone-1.5.0 lib/webdrone/html.rb
webdrone-1.4.8 lib/webdrone/html.rb
webdrone-1.4.6 lib/webdrone/html.rb
webdrone-1.4.4 lib/webdrone/html.rb
webdrone-1.4.2 lib/webdrone/html.rb
webdrone-1.4.0 lib/webdrone/html.rb
webdrone-1.3.6 lib/webdrone/html.rb
webdrone-1.3.4 lib/webdrone/html.rb
webdrone-1.3.2 lib/webdrone/html.rb
webdrone-1.3.0 lib/webdrone/html.rb
webdrone-1.2.2 lib/webdrone/html.rb
webdrone-1.2.0 lib/webdrone/html.rb
webdrone-1.1.4 lib/webdrone/html.rb
webdrone-1.1.2 lib/webdrone/html.rb
webdrone-1.1.0 lib/webdrone/html.rb
webdrone-1.0.8 lib/webdrone/html.rb
webdrone-1.0.6 lib/webdrone/html.rb