selenium explicit wait by xpath code example

Example 1: how to wait for a element to load in selenium

from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC

driver = webdriver.Firefox()
driver.get("http://somedomain/url_that_delays_loading")
try:
    element = WebDriverWait(driver, 10).until(
      # Please Change These Down Below
        EC.presence_of_element_located((By.AnyElementYouWant, "ElementName"))
    )
finally:
    driver.quit()

Example 2: explicit wait in selenium

2- Explicit Wait
explicit is waiting for
explicit condition to happen
Like:
-elementIsDisplayed
-titleIs()
-visibilityOf
-elementToBeClickable

We need to create object from 
webdriverwait class

Tags:

Misc Example