Jun-09-2019, 11:13 PM
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://the-internet.herokuapp.com/dynamic_loading/2") button = driver.find_element_by_xpath("//*/div[@id='start']/button") button.click() print("clicked") WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.XPATH, "//*/div[@id='finish']"))) finish_element=driver.find_element_by_xpath("//*/div[@id='finish']/h4") print(finish_element.text)Thank you. This works, just without double quotes for xpath.