title: Selecting an element with xpath and Selenium
body: <p>I have HTML which looks basically like the following:</p>
  
  <pre><code>...    
    &lt;a class="btnX btnSelectedBG" href="#"&gt;&lt;span&gt;Sign in&lt;/span&gt;&lt;/a&gt;
  ...
  </code></pre>
  
  <p>The following xpath in Selenium fails to find an <em>element</em>:</p>
  
  <pre><code>//a[contains(text(), 'Sign in') and contains(@class,'btnX')]
  </code></pre>
  
  <p>The following xpaths in Selenium succeed, but are not specific enough for me.</p>
  
  <pre><code>//a[contains(text(), 'Sign in')]
  //a[contains(@class, 'btnX')]
  </code></pre>
  
  <p>Why is the xpath failing to find an element, and what can I do to get it to work?</p>