diff options
Diffstat (limited to 'python/download_markit_quotes.py')
| -rw-r--r-- | python/download_markit_quotes.py | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/python/download_markit_quotes.py b/python/download_markit_quotes.py index 1579618b..56ecc902 100644 --- a/python/download_markit_quotes.py +++ b/python/download_markit_quotes.py @@ -5,6 +5,8 @@ from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.support.ui import WebDriverWait +from selenium.common.exceptions import TimeoutException + import time, os from config import markit_login, markit_password from insert_tranche_quotes import insert_quotes @@ -35,9 +37,14 @@ hiddenmenu = WebDriverWait(driver, 10).until( "div.MPopUpMenu div.popupContent table tbody tr:nth-of-type(3) td div"))) hiddenmenu.click() WebDriverWait(driver, 10).until(EC.frame_to_be_available_and_switch_to_it((By.NAME, "MFrame"))) -link = WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.CSS_SELECTOR, -".searchBg_bottom span:nth-child(1) table:nth-child(1) tbody:nth-child(1) tr:nth-child(1) td:nth-child(2) a:nth-child(1)"))) -link.click() +try: + link = WebDriverWait(driver, 10).until(EC.element_to_be_clickable( + (By.CSS_SELECTOR, + ".searchBg_bottom span:nth-child(1) table:nth-child(1) tbody:nth-child(1) " \ + "tr:nth-child(1) td:nth-child(2) a:nth-child(1)"))) + link.click() +except TimeoutException: + logging.info("timeout before being able to click") total_wait = 0 while (not os.path.exists("/tmp/Quotes.csv") or total_wait==10): |
