From 5903fa0fddb7fdd8377970a9710f5a03f1cfea4a Mon Sep 17 00:00:00 2001 From: Leon Date: Sun, 22 Dec 2019 14:45:37 +0100 Subject: [PATCH] Update __init__.py --- undetected_chromedriver/__init__.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/undetected_chromedriver/__init__.py b/undetected_chromedriver/__init__.py index 715752a..dc9b67b 100644 --- a/undetected_chromedriver/__init__.py +++ b/undetected_chromedriver/__init__.py @@ -26,6 +26,8 @@ from urllib.request import urlopen, urlretrieve from selenium.webdriver import Chrome as _Chrome from selenium.webdriver import ChromeOptions as _ChromeOptions +logger = logging.getLogger(__name__) + _DL_BASE = "https://chromedriver.storage.googleapis.com/" TARGET_VERSION = 79 @@ -60,7 +62,7 @@ class Chrome: "platform": "Windows", }, ) - print(f"starting webdriver instance Chrome({args}, {kwargs})") + logger.warning(f"starting webdriver instance Chrome({args}, {kwargs})") return instance @@ -75,7 +77,7 @@ class ChromeOptions: instance.add_argument("start-maximized") instance.add_experimental_option("excludeSwitches", ["enable-automation"]) instance.add_experimental_option("useAutomationExtension", False) - print(f"starting options instance ChromeOptions({args}, {kwargs})") + logger.debug(f"starting options instance ChromeOptions({args}, {kwargs})") return instance # return _ChromeOptions() @@ -102,7 +104,7 @@ class ChromeDriverManager(object): import selenium.webdriver selenium.webdriver.Chrome = Chrome selenium.webdriver.ChromeOptions = ChromeOptions - logging.warning( + logger.warning( "Now it is safe to import Chrome and ChromeOptions from selenium" ) self_.__class__.selenium_patched = True