Answer the question
In order to leave comments, you need to log in
How to wait for webelement clickability (selenium+python)?
Hey! Tell me, is there a way to wait for the clickability of an existing web element?
That is, I already got it from find_elements_by_*
, but when I call the method click()
I get an error
Message: stale element reference: element is not attached to the page document
time.sleep()
before clicking on an element, then everything works correctly. How can I make an element clickable wait? Thanks for the answer!
Answer the question
In order to leave comments, you need to log in
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, "тут xpath"))).click()
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question