def get_body_text(driver,
exponential_multiplier=cfg_wait_exponential_multiplier,
exponential_max=cfg_wait_exponential_max,
stop_max_attempt=cfg_retry_stop_max_attempt):
@retry(
wait_exponential_multiplier=exponential_multiplier,
wait_exponential_max=exponential_max,
stop_max_attempt_number=stop_max_attempt)
def _get_body_text(driver):
try:
e = wait_for_xpath_presence(driver, "//body")
except StaleElementReferenceException:
a_nice_refresh(driver)
e = wait_for_xpath_presence(driver, "//*")
raise StaleElementReferenceException
return e.get_attribute("outerHTML")
return _get_body_text(driver)
# Subbornly clicks on the elements which run away from the DOM
评论列表
文章目录