mirror of
https://github.com/Second-Hand-Friends/kleinanzeigen-bot.git
synced 2026-03-12 10:31:50 +01:00
Allow setting price-type to NOT_APPLICABLE. Addresses #52
This commit is contained in:
@@ -223,7 +223,7 @@ ad_defaults:
|
|||||||
description:
|
description:
|
||||||
prefix: ""
|
prefix: ""
|
||||||
suffix: ""
|
suffix: ""
|
||||||
price_type: NEGOTIABLE # one of: FIXED, NEGOTIABLE, GIVE_AWAY
|
price_type: NEGOTIABLE # one of: FIXED, NEGOTIABLE, GIVE_AWAY, NOT_APPLICABLE
|
||||||
shipping_type: SHIPPING # one of: PICKUP, SHIPPING, NOT_APPLICABLE
|
shipping_type: SHIPPING # one of: PICKUP, SHIPPING, NOT_APPLICABLE
|
||||||
shipping_costs: # e.g. 2.95
|
shipping_costs: # e.g. 2.95
|
||||||
contact:
|
contact:
|
||||||
|
|||||||
@@ -240,8 +240,9 @@ class KleinanzeigenBot(SeleniumMixin):
|
|||||||
assert_one_of("type", ("OFFER", "WANTED"))
|
assert_one_of("type", ("OFFER", "WANTED"))
|
||||||
assert_min_len("title", 10)
|
assert_min_len("title", 10)
|
||||||
assert_has_value("description")
|
assert_has_value("description")
|
||||||
|
assert_one_of("price_type", ("FIXED", "NEGOTIABLE", "GIVE_AWAY", "NOT_APPLICABLE"))
|
||||||
|
if ad_cfg["price_type"] != "NOT_APPLICABLE":
|
||||||
assert_has_value("price")
|
assert_has_value("price")
|
||||||
assert_one_of("price_type", ("FIXED", "NEGOTIABLE", "GIVE_AWAY"))
|
|
||||||
assert_one_of("shipping_type", ("PICKUP", "SHIPPING", "NOT_APPLICABLE"))
|
assert_one_of("shipping_type", ("PICKUP", "SHIPPING", "NOT_APPLICABLE"))
|
||||||
assert_has_value("contact.name")
|
assert_has_value("contact.name")
|
||||||
assert_has_value("republication_interval")
|
assert_has_value("republication_interval")
|
||||||
@@ -415,8 +416,10 @@ class KleinanzeigenBot(SeleniumMixin):
|
|||||||
#############################
|
#############################
|
||||||
# set price
|
# set price
|
||||||
#############################
|
#############################
|
||||||
self.web_select(By.XPATH, "//select[@id='priceType']", ad_cfg["price_type"])
|
price_type = ad_cfg["price_type"]
|
||||||
if ad_cfg["price_type"] != "GIVE_AWAY":
|
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"])
|
self.web_input(By.ID, "pstad-price", ad_cfg["price"])
|
||||||
|
|
||||||
#############################
|
#############################
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ description:
|
|||||||
category:
|
category:
|
||||||
special_attributes: {}
|
special_attributes: {}
|
||||||
price:
|
price:
|
||||||
price_type: # one of: FIXED, NEGOTIABLE, GIVE_AWAY
|
price_type: # one of: FIXED, NEGOTIABLE, GIVE_AWAY, NOT_APPLICABLE
|
||||||
shipping_type: # one of: PICKUP, SHIPPING, NOT_APPLICABLE
|
shipping_type: # one of: PICKUP, SHIPPING, NOT_APPLICABLE
|
||||||
shipping_costs:
|
shipping_costs:
|
||||||
images: []
|
images: []
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ ad_defaults:
|
|||||||
description:
|
description:
|
||||||
prefix: ""
|
prefix: ""
|
||||||
suffix: ""
|
suffix: ""
|
||||||
price_type: NEGOTIABLE # one of: FIXED, NEGOTIABLE, GIVE_AWAY
|
price_type: NEGOTIABLE # one of: FIXED, NEGOTIABLE, GIVE_AWAY, NOT_APPLICABLE
|
||||||
shipping_type: SHIPPING # one of: PICKUP, SHIPPING, NOT_APPLICABLE
|
shipping_type: SHIPPING # one of: PICKUP, SHIPPING, NOT_APPLICABLE
|
||||||
contact:
|
contact:
|
||||||
name: ""
|
name: ""
|
||||||
|
|||||||
Reference in New Issue
Block a user