diff --git a/src/interfaces/mapping.ts b/src/interfaces/mapping.ts index b2a5e44f..0436201e 100644 --- a/src/interfaces/mapping.ts +++ b/src/interfaces/mapping.ts @@ -208,6 +208,7 @@ export interface LocserviceMapping { id: string title: string cityLabel: string + dpe: string | null description: string hasCharges: boolean furnished: boolean diff --git a/src/services/websites/locservice/locservice.scrapping.ts b/src/services/websites/locservice/locservice.scrapping.ts index 34b69944..afeb8fc2 100644 --- a/src/services/websites/locservice/locservice.scrapping.ts +++ b/src/services/websites/locservice/locservice.scrapping.ts @@ -18,11 +18,14 @@ export class LocserviceScrapping { const surface = document.querySelector('#resume_detail > ul > li.surface') const cityLabel = document.querySelector('#YouAreThere > div:nth-child(1)') + const dpe = document.querySelector('#resume_detail > ul > li.dpe > div:nth-child(1) > span') + return { id: null, cityLabel: cityLabel && cityLabel.textContent, hasCharges: price?.textContent.includes('CC'), description: description?.textContent, + dpe: dpe?.textContent, furnished: furnished?.textContent.includes('Loué meublé'), price: price && price.textContent.replace('.', ''), rooms: surface.textContent?.match(/\d+ pièce/g) && surface.textContent?.match(/\d+ pièce/g)[0],