title: How to include an attribute in an XPath selection
body: <p>I am using selenium to move through the pages.</p>
  
  <p>Following is the page source:</p>
  
  <pre><code>&lt;td colspan="10" align="right"&gt;
                  &lt;input type="button" name="previous" value="Previous" onclick="this.form.action = 'coca-cola-north-america-group-company-37452.htm?previous=true&amp;currentPage=6';this.form.submit();" &gt; 
                  &lt;input type="hidden" name="currentPage" id="currentPage" value="6" /&gt;
  
                  &lt;input type="button" name="next" value="Next" onclick="this.form.action = 'coca-cola-north-america-group-company-37452.htm?next=true&amp;currentPage=6';this.form.submit();" &gt;
              &lt;/td&gt;
  
  
  &lt;td colspan="10" align="right"&gt;
                  &lt;input type="button" name="previous" value="Previous" onclick="this.form.action = 'coca-cola-north-america-group-company-37452.htm?previous=true&amp;currentPage=7';this.form.submit();" &gt; 
                  &lt;input type="hidden" name="currentPage" id="currentPage" value="7" /&gt;
  </code></pre>
  
  <p>I am using seleniums click method to click the next page,</p>
  
  <pre><code>browser.find_element_by_xpath('//*[@name="next"]').click()                  
  </code></pre>
  
  <p>Now when I come to the last page (below is the source code) I get the same xpath (for next page link)--- with attribute <code>disabled</code> at the end. And I want selenium to stop here.</p>
  
  <p>However I am not sure how to include the <code>disabled</code> attribute in the xpath.</p>
  
  <pre><code>                &lt;input type="button" name="next" value="Next" onclick="this.form.action = 'coca-cola-north-america-group-company-37452.htm?next=true&amp;currentPage=7';this.form.submit();" disabled&gt;
              &lt;/td&gt;
  </code></pre>