From 361b88c843d8d584e31befb4d6a2602973b972ea Mon Sep 17 00:00:00 2001 From: Oleg Loewen <44769983+OlegLoewen@users.noreply.github.com> Date: Mon, 7 Mar 2022 15:49:12 +0100 Subject: [PATCH] support special category attributes (#33) --- README.md | 3 +++ kleinanzeigen_bot/__init__.py | 7 +++++++ kleinanzeigen_bot/resources/ad_fields.yaml | 1 + 3 files changed, 11 insertions(+) diff --git a/README.md b/README.md index c58f15b..3d37acf 100644 --- a/README.md +++ b/README.md @@ -273,6 +273,9 @@ category: Notebooks price: price_type: # one of: FIXED, NEGOTIABLE, GIVE_AWAY +special_attributes: + haus_mieten.zimmer_d: 5 # Zimmer + shipping_type: # one of: PICKUP, SHIPPING, NOT_APPLICABLE # list of wildcard patterns to select images diff --git a/kleinanzeigen_bot/__init__.py b/kleinanzeigen_bot/__init__.py index c629427..785c239 100644 --- a/kleinanzeigen_bot/__init__.py +++ b/kleinanzeigen_bot/__init__.py @@ -404,6 +404,13 @@ class KleinanzeigenBot(SeleniumMixin): if ad_cfg["price_type"] != "GIVE_AWAY": self.web_input(By.ID, "pstad-price", ad_cfg["price"]) + ############################# + # set special properties of category + ############################# + if ad_cfg["special_attributes"]: + for special_property_key, special_property_value in ad_cfg["special_attributes"]: + self.web_input(By.ID, special_property_key, special_property_value) + ############################# # set description ############################# diff --git a/kleinanzeigen_bot/resources/ad_fields.yaml b/kleinanzeigen_bot/resources/ad_fields.yaml index efea629..c944e7e 100644 --- a/kleinanzeigen_bot/resources/ad_fields.yaml +++ b/kleinanzeigen_bot/resources/ad_fields.yaml @@ -3,6 +3,7 @@ type: title: description: category: +special_attributes: {} price: price_type: shipping_type: