Skip to content

Commit 5c278e1

Browse files
committed
update expired poperty page urls and properly catch exceptions
1 parent e97b0e3 commit 5c278e1

File tree

3 files changed

+73
-74
lines changed

3 files changed

+73
-74
lines changed

immobilienscout24-scraper/immobilienscout24.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,12 +183,11 @@ async def scrape_properties(urls: List[str]) -> List[Dict]:
183183
properties = []
184184
# scrape all property pages concurrently
185185
async for response in SCRAPFLY.concurrent_scrape(to_scrape):
186-
data = parse_property_page(response)
187-
# handle expired property pages
188186
try:
187+
data = parse_property_page(response)
189188
properties.append(data)
190189
except:
191-
log.info("expired property page")
190+
log.error("an issue occurred while parsing property page, is the listing expired?")
192191
pass
193192
log.info(f"scraped {len(properties)} property listings")
194193
return properties

immobilienscout24-scraper/results/properties.json

Lines changed: 68 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,43 @@
11
[
22
{
3-
"id": 159732430,
4-
"title": "*Klein, fein & mit Garten – 1-Zi.-Erdgeschosswohnung mit Ostterrasse zum Erstbezug in der Fasanerie*",
5-
"description": "Erdgeschosswohnung (Wohnung/Miete): 1 Zimmer - 22,3 qm - Feldmochinger Straße 206, 80995 München, Feldmoching bei ImmobilienScout24 (Scout-ID: 159732430)",
6-
"address": "Lerchenau-West, 80995 München",
7-
"propertyLlink": "https://www.immobilienscout24.de/expose/159732430",
3+
"id": 161789365,
4+
"title": "Gut geschnittene 3-Zimmer-Wohnung mit Südbalkon und guter Infrastruktur in Bogenhausen!",
5+
"description": "Etagenwohnung (Wohnung/Miete): 3 Zimmer - 80 qm - Bogenhausen bei ImmobilienScout24 (Scout-ID: 161789365)",
6+
"address": "Die vollständige Adresse der Immobilie erhalten Sie vom Anbieter.",
7+
"propertyLlink": "https://www.immobilienscout24.de/expose/161789365",
88
"propertySepcs": {
9-
"floorsNumber": null,
10-
"livingSpace": "22,34",
9+
"floorsNumber": "1",
10+
"livingSpace": "80",
1111
"livingSpaceUnit": "Square Meter",
12-
"vacantFrom": "01.12.2025",
13-
"numberOfRooms": 1,
14-
"Garage/parking space": "1 Tiefgaragen-Stellplatz",
12+
"vacantFrom": null,
13+
"numberOfRooms": 3,
14+
"Garage/parking space": null,
1515
"additionalSpecs": [
16+
"\n Online-Besichtigung möglich\n \n\n\n\n\n\n\n\n\n\n\n\n\n ",
1617
"Balkon/ Terrasse",
17-
"Keller",
18-
"Personenaufzug",
18+
"Einbauküche",
1919
"Garten/ -mitbenutzung"
2020
],
2121
"internetAvailable": true
2222
},
2323
"price": {
24-
"priceWithoutHeadting": "750",
25-
"priceperMeter": "33,57 €/m²",
26-
"additionalCosts": "90",
24+
"priceWithoutHeadting": "1.680",
25+
"priceperMeter": "21 €/m²",
26+
"additionalCosts": "420",
2727
"heatingCosts": "in Nebenkosten enthalten",
28-
"totalRent": "935",
29-
"basisRent": "750",
30-
"deposit": "2.535",
31-
"garage/parkingRent": "95 €",
28+
"totalRent": "2.100",
29+
"basisRent": "1.680",
30+
"deposit": "5.040,00",
31+
"garage/parkingRent": null,
3232
"priceCurrency": ""
3333
},
3434
"building": {
35-
"constructionYear": 2025,
36-
"energySources": "Nahwärme",
35+
"constructionYear": 1972,
36+
"energySources": "Gas",
3737
"energyCertificate": "liegt vor",
3838
"energyCertificateType": "liegt vor",
39-
"energyCertificateDate": 2025,
40-
"finalEnergyRrequirement": "37,8 kWh/(m²*a)"
39+
"energyCertificateDate": 1972,
40+
"finalEnergyRrequirement": "193,8 kWh/(m²*a)"
4141
},
4242
"attachments": {
4343
"propertyImages": [],
@@ -47,45 +47,47 @@
4747
"agencyAddress": ""
4848
},
4949
{
50-
"id": 159774694,
51-
"title": "Erstklassiger Neubau: 3-Zimmer-Wohnung mit Einbauküche & Balkon",
52-
"description": "Etagenwohnung (Wohnung/Miete): 3 Zimmer - 87,1 qm - Friederike-Nadig-Allee 96, 80939 München, Freimann bei ImmobilienScout24 (Scout-ID: 159774694)",
53-
"address": "Freimann, 80939 München",
54-
"propertyLlink": "https://www.immobilienscout24.de/expose/159774694",
50+
"id": 160756318,
51+
"title": "OPEN HOUSE Besichtigung: 25.09. von 17:30 bis 19:30 Uhr - Moderne 3-Zimmer-Whg. in Nymphenburg",
52+
"description": "Etagenwohnung (Wohnung/Miete): 3 Zimmer - 82,2 qm - Nymphenburg bei ImmobilienScout24 (Scout-ID: 160756318)",
53+
"address": "Die vollständige Adresse der Immobilie erhalten Sie vom Anbieter.",
54+
"propertyLlink": "https://www.immobilienscout24.de/expose/160756318",
5555
"propertySepcs": {
56-
"floorsNumber": "2 von 6",
57-
"livingSpace": "87,08",
56+
"floorsNumber": null,
57+
"livingSpace": "82,2",
5858
"livingSpaceUnit": "Square Meter",
59-
"vacantFrom": "01.07.2025",
59+
"vacantFrom": "15.8.2025",
6060
"numberOfRooms": 3,
61-
"Garage/parking space": null,
61+
"Garage/parking space": "26 Außenstellplätze",
6262
"additionalSpecs": [
63-
"\n \n\n\n\n\n\n\n\n\n\n\n\n\n ",
6463
"Balkon/ Terrasse",
6564
"Keller",
6665
"Personenaufzug",
67-
"Einbauküche"
66+
"Einbauküche",
67+
"Gäste-WC",
68+
"Stufenloser Zugang",
69+
"WG-geeignet"
6870
],
69-
"internetAvailable": true
71+
"internetAvailable": false
7072
},
7173
"price": {
72-
"priceWithoutHeadting": "1.865",
73-
"priceperMeter": "21,42 €/m²",
74-
"additionalCosts": "190",
75-
"heatingCosts": "105",
76-
"totalRent": "2.160",
77-
"basisRent": "1.865",
78-
"deposit": "5595",
79-
"garage/parkingRent": null,
74+
"priceWithoutHeadting": "1.990",
75+
"priceperMeter": "24,21 €/m²",
76+
"additionalCosts": "150",
77+
"heatingCosts": "150",
78+
"totalRent": "2.290",
79+
"basisRent": "1.990",
80+
"deposit": "5970,00",
81+
"garage/parkingRent": "100 €",
8082
"priceCurrency": ""
8183
},
8284
"building": {
83-
"constructionYear": 2024,
84-
"energySources": "Fernwärme",
85+
"constructionYear": 1963,
86+
"energySources": "Wasserenergie",
8587
"energyCertificate": "liegt vor",
8688
"energyCertificateType": "liegt vor",
87-
"energyCertificateDate": 2024,
88-
"finalEnergyRrequirement": "69 kWh/(m²*a)"
89+
"energyCertificateDate": 1963,
90+
"finalEnergyRrequirement": null
8991
},
9092
"attachments": {
9193
"propertyImages": [],
@@ -95,42 +97,40 @@
9597
"agencyAddress": ""
9698
},
9799
{
98-
"id": 126279482,
99-
"title": "Home & Co – Easy Living | Möbliertes All-Inclusive Wohnen",
100-
"description": "Etagenwohnung (Wohnung/Miete): 1 Zimmer - 24 qm - Baierbrunner Straße 50, 81379 München, Obersendling bei ImmobilienScout24 (Scout-ID: 126279482)",
101-
"address": "Obersendling, 81379 München",
102-
"propertyLlink": "https://www.immobilienscout24.de/expose/126279482",
100+
"id": 160519246,
101+
"title": "Doppelzimmer im CAMPO NOVO Business München - Die angenehme Unterkunft auf Zeit! All-Inclusive!",
102+
"description": "Mietwohnung (Wohnung/Miete): 1 Zimmer - 25 qm - Marsstraße 6, 80335 München, Maxvorstadt bei ImmobilienScout24 (Scout-ID: 160519246)",
103+
"address": "Augustenstraße, 80335 München",
104+
"propertyLlink": "https://www.immobilienscout24.de/expose/160519246",
103105
"propertySepcs": {
104106
"floorsNumber": null,
105-
"livingSpace": "24",
107+
"livingSpace": "25",
106108
"livingSpaceUnit": "Square Meter",
107-
"vacantFrom": "01.10.2025",
109+
"vacantFrom": "04.09.2025",
108110
"numberOfRooms": 1,
109111
"Garage/parking space": null,
110112
"additionalSpecs": [
111-
"Keller",
112-
"Personenaufzug",
113-
"Einbauküche"
113+
"Personenaufzug"
114114
],
115-
"internetAvailable": true
115+
"internetAvailable": false
116116
},
117117
"price": {
118-
"priceWithoutHeadting": "979",
119-
"priceperMeter": "40,79 €/m²",
120-
"additionalCosts": "300",
121-
"heatingCosts": "in Nebenkosten enthalten",
122-
"totalRent": "1.279 ",
123-
"basisRent": "979",
124-
"deposit": "2038€",
118+
"priceWithoutHeadting": "962,62",
119+
"priceperMeter": "38,50 €/m²",
120+
"additionalCosts": "437,38",
121+
"heatingCosts": "keine Angabe",
122+
"totalRent": "~1.440 ",
123+
"basisRent": "962,62",
124+
"deposit": "keine",
125125
"garage/parkingRent": null,
126126
"priceCurrency": ""
127127
},
128128
"building": {
129-
"constructionYear": null,
130-
"energySources": "Fernwärme",
129+
"constructionYear": 1984,
130+
"energySources": "KWK fossil",
131131
"energyCertificate": "liegt vor",
132132
"energyCertificateType": "liegt vor",
133-
"energyCertificateDate": null,
133+
"energyCertificateDate": 1984,
134134
"finalEnergyRrequirement": null
135135
},
136136
"attachments": {

immobilienscout24-scraper/run.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ async def run():
2828

2929
properties_data = await immobilienscout24.scrape_properties(
3030
urls = [
31-
"https://www.immobilienscout24.de/expose/126279482#/",
32-
"https://www.immobilienscout24.de/expose/159774694#/",
33-
"https://www.immobilienscout24.de/expose/159732430#/",
31+
"https://www.immobilienscout24.de/expose/160519246#/",
32+
"https://www.immobilienscout24.de/expose/160756318#/",
33+
"https://www.immobilienscout24.de/expose/161789365#/",
3434
]
3535
)
3636
with open(output.joinpath("properties.json"), "w", encoding="utf-8") as file:

0 commit comments

Comments
 (0)