title: Selenium Webdriver Python How to get text from the input tag
body: <p>I am trying to get the value of a textfield.  The textfield is in an Input tag in the html.  I want to print out it's value.
  I am getting nothing printed out to the console.
  I have identified the element with the following XPATH</p>
  
  <pre><code>By.XPATH, '//span[@class="gwt-InlineLabel marginbelow myinlineblock" and contains(text(), "Type")]/following-sibling::*'
  </code></pre>
  
  <p>My code snippet is</p>
  
  <pre><code> def get_type_field_value(self):
          type_field_element = self.driver.find_element(By.XPATH, 'By.XPATH, '//span[@class="gwt-InlineLabel marginbelow myinlineblock" and contains(text(), "Type")]/following-sibling::*'')
          print type_field_element.text
  </code></pre>
  
  <p>The HTML is:</p>
  
  <pre><code>&lt;div class="clear"&gt;
      &lt;span class="gwt-InlineLabel marginbelow myinlineblock" style="width: 8em;"&gt;Type&lt;/span&gt;
      &lt;input class="gwt-TextBox marginbelow" type="text" disabled="" style="display: inline;"/&gt;
   &lt;/div&gt;
  </code></pre>
  
  <p>I have also tried the following method:</p>
  
  <pre><code>def get_type_field_value2(self):
      return self.driver.execute_script("""
          return jQuery(arguments[0]).contents().filter(function() {
          return this.nodeType == Node.TEXT_NODE;
          }).text();
          """, self.driver.find_element(By.XPATH, '//span[@class="gwt-InlineLabel marginbelow myinlineblock" and contains(text(), "Type")]/following-sibling::*'))
  </code></pre>
  
  <p>I get a JavaScript error:</p>
  
  <pre><code>raise exception_class(message, screen, stacktrace)
  WebDriverException: Message: JavaScript error
  </code></pre>
  
  <p>How do i get the value of the Textfield?</p>
  
  <p>Thanks,</p>