Python Forum
Error clicking button with selenium - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Web Scraping & Web Development (https://python-forum.io/forum-13.html)
+--- Thread: Error clicking button with selenium (/thread-23563.html)



Error clicking button with selenium - julio2000 - Jan-05-2020

time.sleep(5)
driver.find_element_by_css_selector('.js-checkout-step-submit').click()
time.sleep(0.4)
This above is just a piece of my code with.

When I run this with the other code I've written it gives this error:
selenium.common.exceptions.ElementNotInteractableException: Message: element not interactable


I am pretty sure the path ('.js-checkout-step-submit') to the button I want selenium to click is right because I found is right. Cause I used SelectorGadget to find it wich worked well for me before.

Does someone have an idea what is going on or could someone maybe help me?


RE: Error clicking button with selenium - metulburr - Jan-05-2020

First instead of some arbitrary wait, i would wait until that specific element is loaded to ensure it is loaded before trying to click it.


RE: Error clicking button with selenium - julio2000 - Jan-05-2020

(Jan-05-2020, 10:09 PM)metulburr Wrote: First instead of some arbitrary wait, i would wait until that specific element is loaded to ensure it is loaded before trying to click it.
The element was loaded


RE: Error clicking button with selenium - metulburr - Jan-06-2020

Have you tried xpath by any chance? Are you sure that is the only element with that class name? Have you tried ActionChains and moving to the element?

Can you post the code or give us the website with the navigation to the element for us to try ourselves?


RE: Error clicking button with selenium - julio2000 - Jan-06-2020

https://www.snipes.nl/checkout?stage=payment#payment
it's a checkout so you first have to add something to your cart. The button I can't click is the button that says 'verder'(Dutch). in English that button would say 'continue'.