diff --git a/data/weather_capture.py b/data/weather_capture.py index 2d1411b..07d79b9 100644 --- a/data/weather_capture.py +++ b/data/weather_capture.py @@ -40,7 +40,8 @@ try: list_button_xpath = '//*[@id="digital-forecast"]/div[1]/div[3]/ul/div[1]/a[2]' for attempt in range(5): try: - list_button = wait.until(EC.element_to_be_clickable((By.XPATH, list_button_xpath))) + list_button = wait.until(EC.presence_of_element_located((By.XPATH, list_button_xpath))) + wait.until(EC.element_to_be_clickable((By.XPATH, list_button_xpath))) list_button.click() break except StaleElementReferenceException: