diff --git a/src/kleinanzeigen_bot/__init__.py b/src/kleinanzeigen_bot/__init__.py index 808896e..0e0dc3c 100644 --- a/src/kleinanzeigen_bot/__init__.py +++ b/src/kleinanzeigen_bot/__init__.py @@ -766,16 +766,20 @@ class KleinanzeigenBot(WebScrapingMixin): ############################# # set shipping type/options/costs ############################# - if ad_cfg.type == "WANTED": - # special handling for ads of type WANTED since shipping is a special attribute for these - if ad_cfg.shipping_type in {"PICKUP", "SHIPPING"}: - shipping_value = "ja" if ad_cfg.shipping_type == "SHIPPING" else "nein" - try: - await self.web_select(By.XPATH, "//select[contains(@id, '.versand_s')]", shipping_value) - except TimeoutError: - LOG.warning("Failed to set shipping attribute for type '%s'!", ad_cfg.shipping_type) + shipping_type = ad_cfg.shipping_type + if shipping_type != "NOT_APPLICABLE": + if ad_cfg.type == "WANTED": + # special handling for ads of type WANTED since shipping is a special attribute for these + if shipping_type in {"PICKUP", "SHIPPING"}: + shipping_value = "ja" if shipping_type == "SHIPPING" else "nein" + try: + await self.web_select(By.XPATH, "//select[contains(@id, '.versand_s')]", shipping_value) + except TimeoutError: + LOG.warning("Failed to set shipping attribute for type '%s'!", shipping_type) + else: + await self.__set_shipping(ad_cfg, mode) else: - await self.__set_shipping(ad_cfg, mode) + LOG.debug("Shipping step skipped - reason: NOT_APPLICABLE") ############################# # set price diff --git a/src/kleinanzeigen_bot/resources/translations.de.yaml b/src/kleinanzeigen_bot/resources/translations.de.yaml index bc70186..3ab51bf 100644 --- a/src/kleinanzeigen_bot/resources/translations.de.yaml +++ b/src/kleinanzeigen_bot/resources/translations.de.yaml @@ -89,6 +89,7 @@ kleinanzeigen_bot/__init__.py: "Publishing ad '%s'...": "Veröffentliche Anzeige '%s'..." "Updating ad '%s'...": "Aktualisiere Anzeige '%s'..." "Failed to set shipping attribute for type '%s'!": "Fehler beim setzen des Versandattributs für den Typ '%s'!" + "Shipping step skipped - reason: NOT_APPLICABLE": "Versandschritt übersprungen: Versand nicht anwendbar (Status = NOT_APPLICABLE)" "# Payment form detected! Please proceed with payment.": "# Bestellformular gefunden! Bitte mit der Bezahlung fortfahren." " -> SUCCESS: ad published with ID %s": " -> ERFOLG: Anzeige mit ID %s veröffentlicht" " -> SUCCESS: ad updated with ID %s": " -> ERFOLG: Anzeige mit ID %s aktualisiert"