title: Ruby Watir to get specific html element of a page
body: <p>I have already try this one:</p>
  
  <pre><code>puts browser.text
  </code></pre>
  
  <p>and it works. I would like to ask if it is possible to display or print only the specific element or html tags.
  For example this one:</p>
  
  <pre><code>&lt;button class="btn btn-add" data-role="add"&gt;Add New User&lt;/button&gt;
  </code></pre>
  
  <p>Is there any way to get this element only? Not the whole Page source.
   I also try</p>
  
  <pre><code>puts @browser.button(:class =&gt; "btn btn-add").html
  </code></pre>
  
  <p>and the error is:</p>
  
  <pre><code>1) Error:
  test_login(TC_Login):
  Selenium::WebDriver::Error::JavascriptError: invalid 'in' operand a
      [remote server] http://sample.org/user/ line 68 &gt; Function:18:in `G'
      [remote server] http://sample.org/user/ line 68 &gt; Function:18:in `anonymous/&lt;/&lt;'
      [remote server] http://sample.org/user/ line 68 &gt; Function:15:in `anonymous/&lt;'
      [remote server] http://sample.org/user/ line 68 &gt; Function:15:in `anonymous'
      [remote server] http://sample.org/user/:68:in `handleEvaluateEvent'
      c:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.44.0/lib/selenium/webdriver/remote/response.rb:52:in `assert_ok'
      c:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.44.0/lib/selenium/webdriver/remote/response.rb:15:in `initialize'
      c:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.44.0/lib/selenium/webdriver/remote/http/common.rb:59:in `new'
      c:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.44.0/lib/selenium/webdriver/remote/http/common.rb:59:in `create_response'
      c:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.44.0/lib/selenium/webdriver/remote/http/default.rb:66:in `request'
      c:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.44.0/lib/selenium/webdriver/remote/http/common.rb:40:in `call'
      c:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.44.0/lib/selenium/webdriver/remote/bridge.rb:640:in `raw_execute'
      c:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.44.0/lib/selenium/webdriver/remote/bridge.rb:618:in `execute'
      c:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.44.0/lib/selenium/webdriver/remote/bridge.rb:339:in `executeScript'
      c:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.44.0/lib/selenium/webdriver/common/driver.rb:193:in `execute_script'
      c:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-webdriver-0.6.11/lib/watir-webdriver/atoms.rb:20:in `execute_atom'
      c:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-webdriver-0.6.11/lib/watir-webdriver/elements/element.rb:290:in `outer_html'
      excel.rb:277:in `test_login'
  </code></pre>