title: Selenium WebDriver java
body: <p>I am using Mozilla firefox 44.0.1 &amp; java version 1.8  &amp; selenium Version 2.48</p>
  
  <p>I am using following <a href="https://uk.webuy.com/search/index.php?stext=*&amp;section=&amp;catid=956" rel="nofollow">Web Page</a></p>
  
  <p>I need to select an item &amp; press "I want to buy this item" button, which creates
  1 item in basket area.  as soon as you add, basket on top right gets updated.
  you will see:</p>
  
  <blockquote>
    <p>1 item/s  View Basket</p>
  </blockquote>
  
  <p>I am having problem locating this item , &amp; I get "unable to locate element" error.
  I have following line to locate the element:</p>
  
  <pre><code>String count = driver.findElement(By.id("buyBasketCount")).getText();
  </code></pre>
  
  <p>and I tried:</p>
  
  <pre><code>String count = driver.findElement(By.xpath("//div[@class='buyBasketContent']/td[1]/span")).getText();
  </code></pre>
  
  <p>How do I access this element? I am trying to get value of one returned by variable count. but I get unable to locate element.  </p>
  
  <p>How do I access this element in the page?</p>