Skip to content

Commit

Permalink
fix: bwsg scraper checks if 'Wohnfläche' exists before using it
Browse files Browse the repository at this point in the history
  • Loading branch information
rettetdemdativ committed Jun 25, 2024
1 parent 1207702 commit 6e88f6e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scrapers/impl/scraper_bwsg.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ def bwsg_scraper(timerObj: func.TimerRequest, q: func.Out[str]) -> None:

room_count = bwsg_description.get("Zimmer", None)
listing["roomCount"] = int(room_count) if room_count is not None else None
square_meters = re.findall(r'(\d+[.,\d]*)', bwsg_description["Wohnfläche"])
if "Wohnfläche" in bwsg_description:
square_meters = re.findall(r'(\d+[.,\d]*)', bwsg_description["Wohnfläche"])
listing["squareMeters"] = float(square_meters[0].replace(',', '.'))
listing["availabilityDate"] = format_date(bwsg_description.get("Beziehbar", ""))
listing["yearBuilt"] = int(bwsg_description.get("Baujahr", "-1"))
Expand Down

0 comments on commit 6e88f6e

Please sign in to comment.