feat: Allow individual shipping without setting shipping costs (#626)

This commit is contained in:
Heavenfighter
2025-09-09 11:24:46 +02:00
committed by GitHub
parent a913d00e23
commit c9d5c03ad2

View File

@@ -1112,10 +1112,8 @@ class KleinanzeigenBot(WebScrapingMixin):
else: else:
try: try:
# no options. only costs. Set custom shipping cost # no options. only costs. Set custom shipping cost
if ad_cfg.shipping_costs is not None:
await self.web_click(By.XPATH, await self.web_click(By.XPATH,
'//button//span[contains(., "Versandmethoden auswählen")]') '//button//span[contains(., "Versandmethoden auswählen")]')
try: try:
# when "Andere Versandmethoden" is not available, then we are already on the individual page # when "Andere Versandmethoden" is not available, then we are already on the individual page
await self.web_click(By.XPATH, await self.web_click(By.XPATH,
@@ -1132,6 +1130,7 @@ class KleinanzeigenBot(WebScrapingMixin):
except TimeoutError: except TimeoutError:
await self.web_click(By.XPATH, '//*[contains(@id, "INDIVIDUAL") and contains(@data-testid, "Individueller Versand")]') await self.web_click(By.XPATH, '//*[contains(@id, "INDIVIDUAL") and contains(@data-testid, "Individueller Versand")]')
if ad_cfg.shipping_costs is not None:
await self.web_input(By.XPATH, '//input[contains(@placeholder, "Versandkosten (optional)")]', await self.web_input(By.XPATH, '//input[contains(@placeholder, "Versandkosten (optional)")]',
str.replace(str(ad_cfg.shipping_costs), ".", ",")) str.replace(str(ad_cfg.shipping_costs), ".", ","))
await self.web_click(By.XPATH, '//dialog//button[contains(., "Fertig")]') await self.web_click(By.XPATH, '//dialog//button[contains(., "Fertig")]')