Skip to content

Commit

Permalink
fix: No HTML element found using CSS selector (#354)
Browse files Browse the repository at this point in the history
Fixes #351
Fixes #353
  • Loading branch information
Heavenfighter authored Dec 8, 2024
1 parent e89e311 commit 9a82645
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/kleinanzeigen_bot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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("############################################")
Expand Down Expand Up @@ -564,7 +567,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:
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit 9a82645

Please sign in to comment.