I know this has been asked lots of times before but how do you get around the "element not interactable" exception?
Here is my code:
button = driver.find_element_by_class_name(u"infoDismiss")
type(button)
button.click()
driver.implicitly_wait(10)
Here is the HTML:
<button class="dismiss infoDismiss">
<string for="inplay_button_dismiss">Dismiss</string>
</button>
And here is the error message:
selenium.common.exceptions.ElementNotInteractableException: Message:
After is says message there is literally nothing.
I have spent lots of time searching the web, not finding anything that solves my issue. I would really appreciate an answer.
Edit: Changed "w" to driver so it is easier to read
Update: I have just realized that I've found the HTML of the wrong button! The real button HTML is below:
<button class="dismiss">
<string for="exit">Dismiss</string>
</button>
Also, I've used the answers and comments and edited my code to look like this:
button = driver.find_element_by_css_selector("button.dismiss")
w.implicitly_wait(10)
ActionChains(w).move_to_element(button).click(button)
And now I get a new error:
selenium.common.exceptions.WebDriverException: Message: Tried to run command without establishing a connection
The error happens in line 1: button = driver.find_element_by_css_selector("button.dismiss")
"infoDismiss"
class name? Trybutton = w.find_element_by_css_selector("button.dismiss.infoDismiss")
– Keppel