def isBrowserAlive(driver): try: driver.current_url # or driver.title return True except: return False