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