1from selenium import webdriver
2from selenium.webdriver.common.by import By
3from selenium.webdriver.support.ui import WebDriverWait
4from selenium.webdriver.support import expected_conditions as EC
5
6driver = webdriver.Firefox()
7driver.get("http://somedomain/url_that_delays_loading")
8try:
9 element = WebDriverWait(driver, 10).until(
10 EC.presence_of_element_located((By.ID, "myDynamicElement"))
11 )
12finally:
13 driver.quit()