title: On Selenium WebDriver how to get Text from Span Tag
body: <p>On Selenium Webdriver, how I can retrieve text from a span tag &amp; print?  </p>
  
  <p>I need to extract the text <code>UPS Overnight - Free</code></p>
  
  <p>HTML code are as follow:   </p>
  
  <pre><code>div id="customSelect_3" class="select_wrapper"&gt;
  &lt;div class="select_display hovered"&gt;
  &lt;span class="selectLabel clear"&gt;UPS Overnight - Free&lt;/span&gt;
  </code></pre>
  
  <p>Using following code:</p>
  
  <pre><code>String kk = wd.findElement(By.xpath(//*[@id='customSelect_3']/div[1]/span)).getText();
  System.out.println(kk);
  </code></pre>
  
  <p>But above code is returning/printing text: <code>1</code>.</p>