diff --git a/src/undetected_chromedriver/__init__.py b/src/undetected_chromedriver/__init__.py index 85c88a4..29ef76a 100644 --- a/src/undetected_chromedriver/__init__.py +++ b/src/undetected_chromedriver/__init__.py @@ -729,6 +729,15 @@ class Chrome(selenium.webdriver.chrome.webdriver.WebDriver): logger.debug("gracefully closed browser") except Exception as e: # noqa logger.debug(e, exc_info=True) + # Force kill Chrome process in Windows + # https://github.com/FlareSolverr/FlareSolverr/issues/772 + if os.name == 'nt': + try: + subprocess.call(['taskkill', '/f', '/pid', str(self.browser_pid)], + stdout=subprocess.DEVNULL, + stderr=subprocess.DEVNULL) + except Exception: + pass if ( hasattr(self, "keep_user_data_dir") and hasattr(self, "user_data_dir")