def wait_for_element_absent(driver, selector, by=By.CSS_SELECTOR,<EOL>timeout=settings.LARGE_TIMEOUT):
start_ms = time.time() * <NUM_LIT><EOL>stop_ms = start_ms + (timeout * <NUM_LIT>)<EOL>for x in range(int(timeout * <NUM_LIT:10>)):<EOL><INDENT>try:<EOL><INDENT>driver.find_element(by=by, value=selector)<EOL>now_ms = time.time() * <NUM_LIT><EOL>if now_ms >= stop_ms:<EOL><INDENT>break<EOL><DEDENT>time.sleep(<NUM_LIT:0.1>)<EOL><DEDENT>except Exception:<EOL><INDENT>return True<EOL><DEDENT><DEDENT>plural = "<STR_LIT:s>"<EOL>if timeout == <NUM_LIT:1>:<EOL><INDENT>plural = "<STR_LIT>"<EOL><DEDENT>raise Exception("<STR_LIT>" %<EOL>(selector, timeout, plural))<EOL>
Searches for the specified element by the given selector.
Raises an exception if the element is still present after the
specified timeout.
@Params
driver - the webdriver object
selector - the locator that is used (required)
by - the method to search for the locator (Default: By.CSS_SELECTOR)
timeout - the time to wait for elements in seconds