From d7fec9e4cef89678df0006644b84a684a02edec3 Mon Sep 17 00:00:00 2001 From: Samuel Date: Fri, 8 Mar 2024 12:06:47 +0100 Subject: [PATCH] Fix: Crash on downloading ads with prices >=1000 Eur (#267) Co-authored-by: Sebastian Thomschke --- src/kleinanzeigen_bot/extract.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/kleinanzeigen_bot/extract.py b/src/kleinanzeigen_bot/extract.py index acad9f7..078c81f 100644 --- a/src/kleinanzeigen_bot/extract.py +++ b/src/kleinanzeigen_bot/extract.py @@ -310,7 +310,8 @@ class AdExtractor(WebScrapingMixin): match price_str.split()[-1]: case '€': price_type = 'FIXED' - price = int(price_str.split()[0]) + # replace('.', '') is to remove the thousands separator before parsing as int + price = int(price_str.replace('.', '').split()[0]) case 'VB': price_type = 'NEGOTIABLE' if not price_str == "VB": # can be either 'X € VB', or just 'VB'