fix degewo

This commit is contained in:
Aron Petau 2026-01-05 14:14:42 +01:00
parent 4ea437e3e6
commit 0f2f842e04
3 changed files with 39 additions and 0 deletions

View file

@ -52,6 +52,25 @@ class DegewoHandler(BaseHandler):
except Exception as e:
logger.debug(f"[DEGEWO] Cookie banner dismiss failed: {e}")
# Save debug HTML and screenshot before checking button
try:
html_content = await page.content()
html_path = DATA_DIR / f"degewo_page_{listing['id']}.html"
with open(html_path, 'w', encoding='utf-8') as f:
f.write(html_content)
logger.info(f"[DEGEWO] Saved page HTML to {html_path}")
# Check if listing is no longer available
if "nicht mehr verfügbar" in html_content or "Objekt nicht mehr verfügbar" in html_content:
logger.warning(f"[DEGEWO] Listing no longer available")
result["success"] = False
result["message"] = "Listing no longer available"
result["deactivated"] = True
await page.close()
return result
except Exception as e:
logger.warning(f"[DEGEWO] Could not save HTML: {e}")
logger.info("[DEGEWO] Looking for kontaktieren button...")
apply_btn = await page.query_selector('a:has-text("kontaktieren"), button:has-text("kontaktieren"), a:has-text("Kontaktieren"), button:has-text("Kontaktieren")')
if apply_btn and await apply_btn.is_visible():