title: Using Selenium to find an HTML element with classes inside a href
body: <p>I have an element in my page as follows. How can I use Selenium to get the text, "Add New Member".</p>
  
  <pre><code>&lt;a ng-if="userCanEdit" class="btn btn-primary ng-scope" ui-sref="orgs-add" href="#/orgs/add"&gt;
       &lt;i&gt;Add New Member&lt;/i&gt;
  &lt;/a&gt;
  </code></pre>
  
  <p>I did try this code below, but it does not work</p>
  
  <pre><code>System.out.println( driver.findElement( By.cssSelector( "a[href='#/orgs/add']" ) ).getText() );
  </code></pre>
  
  <p>Also, my javascript console, evaluates the expression, <code>('a[href="#/orgs/add"]')</code> correctly.</p>
  
  <p>EDIT : I just got a crash as follows, when I try the above code.</p>
  
  <pre><code>*** Element info: {Using=css selector, value=a[href='#/orgs/add']}
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
      at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:216)
      at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:168)
      at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:635)
      at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:368)
      at org.openqa.selenium.remote.RemoteWebDriver.findElementByCssSelector(RemoteWebDriver.java:465)
      at org.openqa.selenium.By$ByCssSelector.findElement(By.java:430)
      at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:360)
      at hello.validate(hello.java:101)
      at hello.main(hello.java:60)
  </code></pre>