def get_android_inspect(class_name = false)
      source = get_source

      doctype_string = '<!doctyp'
      source_header  = source[0..doctype_string.length].downcase
      source_is_html = source_header.start_with?(doctype_string, '<html')

      parser = if source_is_html # parse html from webview
                 @android_html_parser ||= Nokogiri::HTML::SAX::Parser.new(Appium::Common::HTMLElements.new)
               else
                 @android_native_parser ||= Nokogiri::XML::SAX::Parser.new(AndroidElements.new)
               end
      parser.document.reset # ensure document is reset before parsing
      parser.document.filter = class_name
      parser.parse source
      result = parser.document.result
      parser.document.reset # clean up any created objects after parsing
      result
    end
def get_android_inspect(class_name = false)
      source = get_source

      doctype_string = '<!doctyp'
      source_header  = source[0..doctype_string.length].downcase
      source_is_html = source_header.start_with?(doctype_string, '<html')

      parser = if source_is_html # parse html from webview
                 @android_html_parser ||= Nokogiri::HTML::SAX::Parser.new(Appium::Common::HTMLElements.new)
               else
                 @android_native_parser ||= Nokogiri::XML::SAX::Parser.new(AndroidElements.new)
               end
      parser.document.reset # ensure document is reset before parsing
      parser.document.filter = class_name
      parser.parse source
      result = parser.document.result
      parser.document.reset # clean up any created objects after parsing
      result
    end
class AndroidElements
 Android only.
 Returns a string containing interesting elements.
 The text, content description, and id are returned.
 @param class_name [String] the class name to filter on.
 if false (default) then all classes will be inspected
 @return [String]