Skip to content

Commit

Permalink
dpe
Browse files Browse the repository at this point in the history
  • Loading branch information
aymericdo committed Jan 13, 2024
1 parent 64c5698 commit 6657cbf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/interfaces/mapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ export interface LocserviceMapping {
id: string
title: string
cityLabel: string
dpe: string | null
description: string
hasCharges: boolean
furnished: boolean
Expand Down
3 changes: 3 additions & 0 deletions src/services/websites/locservice/locservice.scrapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down

0 comments on commit 6657cbf

Please sign in to comment.