diff options
Diffstat (limited to 'python')
| -rw-r--r-- | python/download_markit_quotes.py | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/python/download_markit_quotes.py b/python/download_markit_quotes.py index 0e0fdcf1..7f34a759 100644 --- a/python/download_markit_quotes.py +++ b/python/download_markit_quotes.py @@ -38,10 +38,17 @@ except ElementNotInteractableException: driver.find_element_by_id("username").send_keys(markit_login) driver.find_element_by_id("password").send_keys(markit_password) driver.find_element_by_id("submit").click() -menu = WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.ID, - "QUOTES.Quotes.Quotes"))) -time.sleep(1) -menu.click() +try: + menu = WebDriverWait(driver, 15).until(EC.element_to_be_clickable((By.ID, + "QUOTES.Quotes.Quotes"))) +except TimeoutException: + logging.info("timeout after login") + driver.quit() + sys.exit() +else: + time.sleep(1) + menu.click() + hiddenmenu = WebDriverWait(driver, 10).until( EC.element_to_be_clickable((By.ID, "QUOTES.Quotes.Tranches"))) |
