Skip to content

Commit

Permalink
Fix linter errors for Immowelt crawler
Browse files Browse the repository at this point in the history
  • Loading branch information
codders committed Dec 15, 2024
1 parent 9701ecf commit 37b8e7e
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions flathunter/crawler/immowelt.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,21 +57,22 @@ def extract_data(self, soup: BeautifulSoup):
for adv in advertisements:
try:
title = adv.find("div", {"class": "css-1cbj9xw"}).text
except:
except AttributeError:
title = ""

try:
price = adv.find(
"div", attrs={"data-testid": "cardmfe-price-testid"}).text
except:
except AttributeError:
price = ""

try:
descriptions = adv.find("div", attrs={"data-testid": "cardmfe-keyfacts-testid"}).children
descriptions = adv.find("div",
attrs={"data-testid": "cardmfe-keyfacts-testid"}).children
descriptions = [result.text for result in descriptions]
except:
except AttributeError:
descriptions = []

size = list(filter(lambda x: "m²" in x, descriptions))
try:
size = size[0]
Expand Down Expand Up @@ -122,4 +123,4 @@ def extract_data(self, soup: BeautifulSoup):
entries.append(details)

logger.debug('Number of entries found: %d', len(entries))
return entries
return entries

0 comments on commit 37b8e7e

Please sign in to comment.