From b00a26b93e84c3ff398d9b4d49beb05787a42a0d Mon Sep 17 00:00:00 2001 From: Santiago Buenahora Bustamante Date: Fri, 9 Jul 2021 16:35:53 -0500 Subject: [PATCH] Fixes Issue 201 Fixes https://github.com/ultrafunkamsterdam/undetected-chromedriver/issues/201 --- undetected_chromedriver/v2.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/undetected_chromedriver/v2.py b/undetected_chromedriver/v2.py index bed7dd5..3340f25 100644 --- a/undetected_chromedriver/v2.py +++ b/undetected_chromedriver/v2.py @@ -571,9 +571,8 @@ class Chrome(selenium.webdriver.Chrome): except Exception: # noqa pass - if hasattr(self, 'keep_user_data_dir') \ - and not self.keep_user_data_dir \ - or self.keep_user_data_dir is False: + if hasattr(self, 'keep_user_data_dir') and \ + (not self.keep_user_data_dir or self.keep_user_data_dir is False): for _ in range(3): try: logger.debug("removing profile : %s" % self.user_data_dir)