내용 |
selenium webdriver expected condition sample
--------------------
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
driver = webdriver.Chrome("c:/chromedriver")
driver.get("https://www.weather.go.kr/w/index.do")
element = WebDriverWait(driver, 5).until(
EC.presence_of_element_located((By.CSS_SELECTOR, "div#current-weather span.tmp"))
)
print(element.text)
driver.close() |