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