I am looking for a proper way to implement below in Python Selenium
- Load a page
- Wait for a certain period of time(e.g 30 secs) for a button to be clickable (by calling WebDriverWait)
- If got TimeoutException, reload the page again, i.e. goto step 1)
url = 'https://...'
driver = webdriver.Chrome('./chromedriver')
try:
driver.get(url)
wait = WebDriverWait(driver, 30)
element = wait.until(EC.element_to_be_clickable((By.CLASS_NAME,'button')))
except TimeoutException as e:
<reload the url again>