from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
#until 也属于WebDriverWait,代表一直等待,直到元素可见
#until_not与其相反,判断某个元素直到不存在
#presence_of_element_located主要判断页面元素在页面中存在
element = WebDriverWait(driver,10).until(
EC.presence_of_element_located((By.ID,'side-menu'))
)
driver.find_element_by_xpath('//*[@id="side-menu"]').click()