if len(elements) != 0:
    return elements
return False
with contextlib.closing(webdriver.PhantomJS('phantomjs')) as browser:
    browser.get('mywebsite')
login_form = browser.find_element_by_id('login-form')
email = browser.find_element_by_name('login')
password = browser.find_element_by_name('password')
email.send_keys(login)
password.send_keys(password)
password.send_keys(Keys.RETURN)
ui.WebDriverWait(browser, 10).until(waiter)
Selenium random timeout exceptions without any message