def page(opts = {})
      class_name = opts.is_a?(Hash) ? opts.fetch(:class, nil) : opts

      source = get_source

      # current_context may be nil which breaks start_with
      if current_context && current_context.start_with?('WEBVIEW')
        parser = @android_html_parser ||= Nokogiri::HTML::SAX::Parser.new(Appium::Common::HTMLElements.new)
        parser.document.reset
        parser.document.filter = class_name
        parser.parse source
        result = parser.document.result
        puts result
        result
      else
        parser = Nokogiri::XML::SAX::Parser.new(UITestElementsPrinter.new)
        if class_name
          parser.document.filter = class_name.is_a?(Symbol) ? class_name.to_s : class_name
        end
        parser.parse source
        nil
      end
    end
def page(opts = {})
      class_name = opts.is_a?(Hash) ? opts.fetch(:class, nil) : opts

      source = get_source

      # current_context may be nil which breaks start_with
      if current_context && current_context.start_with?('WEBVIEW')
        parser = @android_html_parser ||= Nokogiri::HTML::SAX::Parser.new(Appium::Common::HTMLElements.new)
        parser.document.reset
        parser.document.filter = class_name
        parser.parse source
        result = parser.document.result
        puts result
        result
      else
        parser = Nokogiri::XML::SAX::Parser.new(UITestElementsPrinter.new)
        if class_name
          parser.document.filter = class_name.is_a?(Symbol) ? class_name.to_s : class_name
        end
        parser.parse source
        nil
      end
    end
Prints a string of interesting elements to the console.

 @example
     ```ruby
     page class: :UIAButton # filter on buttons
     page class: :UIAButton, window: 1
     ```

 @option visible [Symbol] visible value to filter on
 @option class [Symbol] class name to filter on

 @return [void]