mirror of
https://github.com/Second-Hand-Friends/kleinanzeigen-bot.git
synced 2026-03-12 02:31:45 +01:00
Allow setting price-type to NOT_APPLICABLE. Addresses #52
This commit is contained in:
@@ -240,8 +240,9 @@ class KleinanzeigenBot(SeleniumMixin):
|
||||
assert_one_of("type", ("OFFER", "WANTED"))
|
||||
assert_min_len("title", 10)
|
||||
assert_has_value("description")
|
||||
assert_has_value("price")
|
||||
assert_one_of("price_type", ("FIXED", "NEGOTIABLE", "GIVE_AWAY"))
|
||||
assert_one_of("price_type", ("FIXED", "NEGOTIABLE", "GIVE_AWAY", "NOT_APPLICABLE"))
|
||||
if ad_cfg["price_type"] != "NOT_APPLICABLE":
|
||||
assert_has_value("price")
|
||||
assert_one_of("shipping_type", ("PICKUP", "SHIPPING", "NOT_APPLICABLE"))
|
||||
assert_has_value("contact.name")
|
||||
assert_has_value("republication_interval")
|
||||
@@ -415,9 +416,11 @@ class KleinanzeigenBot(SeleniumMixin):
|
||||
#############################
|
||||
# set price
|
||||
#############################
|
||||
self.web_select(By.XPATH, "//select[@id='priceType']", ad_cfg["price_type"])
|
||||
if ad_cfg["price_type"] != "GIVE_AWAY":
|
||||
self.web_input(By.ID, "pstad-price", ad_cfg["price"])
|
||||
price_type = ad_cfg["price_type"]
|
||||
if price_type != "NOT_APPLICABLE":
|
||||
self.web_select(By.XPATH, "//select[@id='priceType']", price_type)
|
||||
if price_type != "GIVE_AWAY":
|
||||
self.web_input(By.ID, "pstad-price", ad_cfg["price"])
|
||||
|
||||
#############################
|
||||
# set description
|
||||
|
||||
Reference in New Issue
Block a user