From 242308c672901caf43ae88085edd4446dab36830 Mon Sep 17 00:00:00 2001 From: sebthom Date: Sun, 23 Oct 2022 23:13:52 +0200 Subject: [PATCH] Fix #117 NoSuchElementException on price entry --- kleinanzeigen_bot/__init__.py | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/kleinanzeigen_bot/__init__.py b/kleinanzeigen_bot/__init__.py index 35605cc..acea637 100644 --- a/kleinanzeigen_bot/__init__.py +++ b/kleinanzeigen_bot/__init__.py @@ -464,16 +464,9 @@ class KleinanzeigenBot(SeleniumMixin): ############################# price_type = ad_cfg["price_type"] if price_type != "NOT_APPLICABLE": - try: - self.web_select(By.XPATH, "//select[@id='price-type-react']", price_type) - if safe_get(ad_cfg, "price"): - self.web_click(By.ID, "post-ad-frontend-price") - self.web_input(By.ID, "post-ad-frontend-price", ad_cfg["price"]) - except NoSuchElementException as ex: - # code for old HTML version can be removed at one point in future - self.web_select(By.XPATH, "//select[@id='priceType']", price_type) - if safe_get(ad_cfg, "price"): - self.web_input(By.ID, "pstad-price", ad_cfg["price"]) + self.web_select(By.XPATH, "//select[@id='price-type-react' or @id='micro-frontend-price-type' or @id='priceType']", price_type) + if safe_get(ad_cfg, "price"): + self.web_input(By.XPATH, "//input[@id='post-ad-frontend-price' or @id='micro-frontend-price' or @id='pstad-price']", ad_cfg["price"]) ############################# # set description