I'm using selenium in Python 2.7 and I have this code, but I'm looking for a more efficient way to do this:
while True:
try:
element = WebDriverWait(driver, 10).until(
EC.presence_of_element_located((By.ID, 'button'))
)
except:
break