Answer the question
In order to leave comments, you need to log in
How to check if an element is present on a website page using selenium?
I have this code for checking an element, this element is not a button, but I still click on it.
def saf():
try:
driver.find_element_by_xpath("//span[@id='progressMessage']").click()
time.sleep(1)
saf()
except:
pass
saf()
Answer the question
In order to leave comments, you need to log in
Use Explicit Expectations
from selenium.webdriver.support import expected_conditions as EC
WebDriverWait(driver, 10).until_not(EC.visibility_of_element_located((By.XPATH, "//span[@id='progressMessage']"))
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question