def click_and_wait_for_page_load(context, elem, wait_time=MAX_PAGE_LOAD_TIME):
 wait_elem = context.browser.find_element_by_tag_name('body')
 elem.click()
 return WebDriverWait(context.browser, wait_time).until(EC.staleness_of(wait_elem))

def click_and_wait_for_page_load ( context , elem , wait_time = MAX_PAGE_LOAD_TIME ) : wait_elem = context . browser . find_element_by_tag_name ( 'body' ) elem . click ( ) return WebDriverWait ( context . browser , wait_time ) . until ( EC . staleness_of ( wait_elem ) )
click an element and then wait for the page to load .