From 845cf88606a73f4498e25d9775cff0583b2fc589 Mon Sep 17 00:00:00 2001 From: Denis Lanz <5640155+DenisLanz@users.noreply.github.com> Date: Wed, 25 May 2022 23:56:56 +0200 Subject: [PATCH] Restore functionality to specify the full ad address (#79) Co-authored-by: DenisLanz Co-authored-by: Sebastian Thomschke --- kleinanzeigen_bot/__init__.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/kleinanzeigen_bot/__init__.py b/kleinanzeigen_bot/__init__.py index f9b0dad..bdc6a5b 100644 --- a/kleinanzeigen_bot/__init__.py +++ b/kleinanzeigen_bot/__init__.py @@ -449,7 +449,14 @@ class KleinanzeigenBot(SeleniumMixin): ############################# # set contact street ############################# - if ad_cfg["contact"]["street"] and self.webdriver.find_element(By.ID, "pstad-street").is_enabled(): + if ad_cfg["contact"]["street"]: + try: + if not self.webdriver.find_element(By.ID, "pstad-street").is_enabled(): + self.webdriver.find_element(By.ID, "addressVisibility").click() + pause(2000) + except NoSuchElementException: + # ignore + pass self.web_input(By.ID, "pstad-street", ad_cfg["contact"]["street"]) #############################