Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: flathunters/flathunter
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: b3c805cc1dc53d7a7f292c691eb59f182a9274bd
Choose a base ref
..
head repository: flathunters/flathunter
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 19caf9e52e25a78434f24599d026bef63620d954
Choose a head ref
Showing with 4 additions and 2 deletions.
  1. +1 −1 flathunter/crawler/immobiliare.py
  2. +3 −1 test/crawler/test_crawl_immobiliare.py
2 changes: 1 addition & 1 deletion flathunter/crawler/immobiliare.py
Original file line number Diff line number Diff line change
@@ -55,7 +55,7 @@ def extract_data(self, soup):

detail_texts = [ item.find("span").text.strip() for item in details_list ]
room_counts = [ match.group(1) for text in detail_texts
if (match := re.match(r"(\d+) local[ie]", text)) is not None ]
if (match := re.match(r"(\d+)\+? local[ie]", text)) is not None ]
if len(room_counts) > 0:
rooms = room_counts[0]
else:
4 changes: 3 additions & 1 deletion test/crawler/test_crawl_immobiliare.py
Original file line number Diff line number Diff line change
@@ -24,4 +24,6 @@ def test(self):
self.assertTrue(entries[0]['url'].startswith(
"https://www.immobiliare.it/annunci/"), u"URL should be an apartment link")
for attr in ['title', 'price', 'size', 'rooms', 'address', 'image']:
self.assertIsNotNone(entries[0][attr], attr + " should be set")
self.assertIsNotNone(
entries[0][attr], attr + " should be set (" + entries[0]['url'] + ")"
)