def find(driver):
    element = driver.find_elements_by_id('data')
if element:
    return element
else:
    return False
element = WebDriverWait(driver, secs).until(find)
Python Selenium stale element fix