title: Java Selenium, how to get linkText (anchor) from link WebElement
body: <p>I have a WebElement containing link found by url.  I can extract url by:</p>
  
  <pre><code>element.getAttribute("href");
  </code></pre>
  
  <p>But the question is: how to extract it's anchor, I'm trying like this:</p>
  
  <pre><code>webElement.getAttribute("linkText");
  </code></pre>
  
  <p>It gives me null value. I'm 100% sure this link has an anchor. Is there any way to get anchor ? It's more complicated, but example simplified code could look like this:</p>
  
  <pre><code>WebDriver driver = new FirefoxDriver();
          driver.get("http://stackoverflow.com/questions/tagged/java");
          WebElement link  = driver.findElement(By.linkText("Bicycles"));
  
          System.out.println(link.getAttribute("href")); // shows http://bicycles.stackexchange.com/
          System.out.println(link.getAttribute("linkText")); // shows null
  </code></pre>