Fix: Crash on downloading ads with prices >=1000 Eur (#267)

Co-authored-by: Sebastian Thomschke <sebthom@users.noreply.github.com>
This commit is contained in:
Samuel
2024-03-08 12:06:47 +01:00
committed by GitHub
parent e99f74bc58
commit d7fec9e4ce

View File

@@ -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'