title: Find button using associated text in selenium
body: <p>I have button details like below.</p>
  
  <pre><code>&lt;button type="button" class="add-to-cart button primary-button false item-action-button"&gt;
            Add to Cart
          &lt;/button&gt;
  </code></pre>
  
  <p>And xpath is <code>/html/body/div/div[2]/div[2]/div/div[4]/div/div[1]/button</code></p>
  
  <p>How do I click on the button?</p>
  
  <p>I tried using this <code>find_element_by_xpath('/button[contains(text(), "Add to Cart")]')</code></p>
  
  <p>But it doesn't work. I don't want to just do .click() on given xpath. Is there way to click by finding text?</p>
  
  <p>I am automating using python</p>