From f3fdf9b78e6aee129db61759af6f9144e3d64395 Mon Sep 17 00:00:00 2001 From: Leon Date: Fri, 24 Apr 2020 14:02:15 +0200 Subject: [PATCH] Update __init__.py --- undetected_chromedriver/__init__.py | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/undetected_chromedriver/__init__.py b/undetected_chromedriver/__init__.py index de3620b..caa8fe8 100644 --- a/undetected_chromedriver/__init__.py +++ b/undetected_chromedriver/__init__.py @@ -30,13 +30,14 @@ logger = logging.getLogger(__name__) _DL_BASE = "https://chromedriver.storage.googleapis.com/" -TARGET_VERSION = 80 +TARGET_VERSION = 81 __is_patched__ = 0 class Chrome: + def __new__(cls, *args, **kwargs): - + if not ChromeDriverManager.installed: ChromeDriverManager(*args, **kwargs).install() if not ChromeDriverManager.selenium_patched: @@ -94,8 +95,6 @@ class ChromeOptions: logger.debug(f"starting options instance ChromeOptions({args}, {kwargs})") return instance - # return _ChromeOptions() - class ChromeDriverManager(object): installed = False @@ -151,12 +150,6 @@ class ChromeDriverManager(object): :return: """ if not os.path.exists(self.executable_path): - -# if -# not self.__class__.installed -# or not __is_patched__ -# or not os.path.exists(self.executable_path) -# ): self.fetch_chromedriver() self.patch_binary() self.__class__.installed = True