title: How do I click 1 of 2 links with same name, no id and same class. selenium java
body: <p>I'm trying to get selenium to click the select button but I can't use <code>by.linkText()</code> because there are two buttons with the same name. 
  I'm using this xpath <code>".//*[contains(@id,'view-something_111111_2A22DF2_)']/div/a[text()='Select']";</code> to find the button but it can't find it. </p>
  
  <p>I've also tried <code>".//*[contains(@id,'view-something_111111_2A22DF2_)']/div/a";</code>.
  I've looked over the Selenium documentation and can't seem to find a solution. </p>
  
  <p>Here is the section of website code:  </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div id="view-something_111111_2A22DF2_0" class="coverage-wrap collapse" aria-expanded="false" style="height: 30px;"&gt;...&lt;/div&gt;
  &lt;div class="btn-raplace"&gt;
    &lt;a class="btn-beer" data-toggle="collapse" data-target="#view-effectData_111111_2A22DF2_0"&gt;Select&lt;/a&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>for reference, the second Select button has this code:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div id="view-something_111111_2A3B5DF2_0" class="coverage-wrap collapse" aria-expanded="false" style="height: 30px;"&gt;...&lt;/div&gt;
  &lt;div class="btn-raplace"&gt;
    &lt;a class="btn-beer" data-toggle="collapse" data-target="#view-effectData_111111_2A3B5DF2_0"&gt;Select&lt;/a&gt;</code></pre>
  </div>
  </div>
  
  which is why I am using the id in my xpath.</p>
  
  <p>Thanks.</p>