From 311311a0f1668e1873292736fa29c275172aa285 Mon Sep 17 00:00:00 2001 From: sebthom Date: Thu, 17 Feb 2022 17:41:12 +0100 Subject: [PATCH] Fix custom profile handling --- kleinanzeigen_bot/__init__.py | 3 ++- kleinanzeigen_bot/selenium_mixin.py | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/kleinanzeigen_bot/__init__.py b/kleinanzeigen_bot/__init__.py index 3b8045d..54a22cc 100644 --- a/kleinanzeigen_bot/__init__.py +++ b/kleinanzeigen_bot/__init__.py @@ -275,7 +275,8 @@ class KleinanzeigenBot(SeleniumMixin): self.browser_config.binary_location = self.config["browser"]["binary_location"] self.browser_config.extensions = [abspath(item, relative_to = self.config_file_path) for item in self.config["browser"]["extensions"]] self.browser_config.use_private_window = self.config["browser"]["use_private_window"] - self.browser_config.user_data_dir = abspath(self.config["browser"]["user_data_dir"], relative_to = self.config_file_path) + if self.config["browser"]["user_data_dir"]: + self.browser_config.user_data_dir = abspath(self.config["browser"]["user_data_dir"], relative_to = self.config_file_path) self.browser_config.profile_name = self.config["browser"]["profile_name"] def login(self) -> None: diff --git a/kleinanzeigen_bot/selenium_mixin.py b/kleinanzeigen_bot/selenium_mixin.py index a6b2a70..0047d12 100644 --- a/kleinanzeigen_bot/selenium_mixin.py +++ b/kleinanzeigen_bot/selenium_mixin.py @@ -62,6 +62,7 @@ class SeleniumMixin: browser_options.add_argument(f"--user-data-dir={self.browser_config.user_data_dir}") if self.browser_config.profile_name: + LOG.info(" -> Browser Profile Name: %s", self.browser_config.profile_name) browser_options.add_argument(f"--profile-directory={self.browser_config.profile_name}") browser_options.add_argument("--disable-crash-reporter")