def destroy_webdriver ( driver ) : # This is some very flaky code in selenium. Hence the retries # and catch-all exceptions try : retry_call ( driver . close , tries = 2 ) except Exception : pass try : driver . quit ( ) except Exception : pass
python webdriver ie unexpectedly exited 2
Destroy a driver
def destroy_webdriver(driver):
    """
    Destroy a driver
    """

    # This is some very flaky code in selenium. Hence the retries
    # and catch-all exceptions
    try:
        retry_call(driver.close, tries=2)
    except Exception:
        pass
    try:
        driver.quit()
    except Exception:
        pass