FIX extract sell directly from ad page

Web element with id `j-buy-now` does not exist anymore. Fetch the `payment-buttons-sidebar` instead and check the text for `Direkt kaufen`
This commit is contained in:
Jeppy
2024-05-30 18:02:01 +02:00
committed by Sebastian Thomschke
parent ba73ebb393
commit b30867ca48

View File

@@ -373,7 +373,7 @@ class AdExtractor(WebScrapingMixin):
:return: a boolean indicating whether the sell directly option is active (optional)
"""
try:
buy_now_is_active:bool = (await self.web_text(By.ID, 'j-buy-now')) == "Direkt kaufen"
buy_now_is_active:bool = 'Direkt kaufen' in (await self.web_text(By.ID, 'payment-buttons-sidebar'))
return buy_now_is_active
except TimeoutError:
return None