From f9140189c35bf15ae7780f2345a1f1c3c6ca3192 Mon Sep 17 00:00:00 2001 From: Heavenfighter Date: Sun, 1 Dec 2024 11:47:35 +0100 Subject: [PATCH 1/2] fix No HTML element found using CSS selector '[class*="jsx-2623555103"] --- src/kleinanzeigen_bot/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/kleinanzeigen_bot/__init__.py b/src/kleinanzeigen_bot/__init__.py index b3c302d..c220497 100644 --- a/src/kleinanzeigen_bot/__init__.py +++ b/src/kleinanzeigen_bot/__init__.py @@ -564,7 +564,7 @@ async def publish_ad(self, ad_file:str, ad_cfg: dict[str, Any], ad_cfg_orig: dic except TimeoutError as ex: LOG.debug(ex, exc_info = True) elif ad_cfg["shipping_options"]: - await self.web_click(By.CSS_SELECTOR, '[class*="jsx-2623555103"]') + await self.web_click(By.CSS_SELECTOR, '[class*="jsx-963945432"]') await self.web_click(By.CSS_SELECTOR, '[class*="CarrierSelectionModal--Button"]') await self.__set_shipping_options(ad_cfg) else: From 791a100e9ad19ca636738e6c1d1eb513b2d18942 Mon Sep 17 00:00:00 2001 From: Heavenfighter Date: Sun, 1 Dec 2024 13:01:24 +0100 Subject: [PATCH 2/2] FIX TimeoutError: No HTML element found with ID 'checking-done' within 5 seconds. Since deleting ad is redirecting to ad overview, the check for element "chhcking-done" has to be done first. --- src/kleinanzeigen_bot/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/kleinanzeigen_bot/__init__.py b/src/kleinanzeigen_bot/__init__.py index c220497..3c25047 100644 --- a/src/kleinanzeigen_bot/__init__.py +++ b/src/kleinanzeigen_bot/__init__.py @@ -506,6 +506,9 @@ async def publish_ads(self, ad_cfgs:list[tuple[str, dict[str, Any], dict[str, An await self.publish_ad(ad_file, ad_cfg, ad_cfg_orig) await self.web_await(lambda: self.web_check(By.ID, "checking-done", Is.DISPLAYED), timeout = 5 * 60) + if self.config["publishing"]["delete_old_ads"] == "AFTER_PUBLISH" and not self.keep_old_ads: + await self.delete_ad(ad_cfg, False) + LOG.info("############################################") LOG.info("DONE: (Re-)published %s", pluralize("ad", count)) LOG.info("############################################") @@ -692,9 +695,6 @@ async def publish_ad(self, ad_file:str, ad_cfg: dict[str, Any], ad_cfg_orig: dic utils.save_dict(ad_file, ad_cfg_orig) - if self.config["publishing"]["delete_old_ads"] == "AFTER_PUBLISH" and not self.keep_old_ads: - await self.delete_ad(ad_cfg, False) - async def __set_condition(self, condition_value: str) -> None: condition_mapping = { "new_with_tag": "Neu mit Etikett",