title: Using Xpath to get text from span- webdriver
body: <p>I'm using selenium webdriver to get some text on my webpage using xpath.</p>
  
  <p>This is the code</p>
  
  <pre><code>&lt;a class="ng-binding" data-toggle="tab" href="#tabCreatedByMe"&gt;
                              Created By Me                              
  &lt;span class="badge ng-binding"&gt;3&lt;/span&gt;
  &lt;/a&gt;
  </code></pre>
  
  <p>I need to get the number '3'. this number is changing everytime</p>
  
  <p>I made this code but it does not return anything</p>
  
  <pre><code>public String getAmountSubtab1() throws InterruptedException{
      WebElement s =  driver.findElement(By.xpath("//*[@class='badge ng-binding']"));
      return s.getText(); }
  </code></pre>
  
  <p>Suggestions?</p>