🐛 Corrige le parsing de l'énergie si vide de Ouest France #16

Merged
Shikiryu merged 1 commits from bug/15/ouestfrance_bug into main 2020-11-09 15:38:56 +01:00
Showing only changes of commit 020cd78822 - Show all commits

View File

@ -24,7 +24,8 @@ class OuestFrance extends Parser
$parsedHome->surface = (int)str_replace(' ', '', $details->eq(2)->filter('strong')->text());
$parsedHome->garden_surface = (int)str_replace(' ', '', $details->eq(3)->filter('strong')->text());
$parsedHome->rooms = (int)str_replace(' ', '', $details->eq(4)->filter('strong')->text());
$parsedHome->energy = $crawler->filter('#dpeCateg > strong')->text();
$dpeCateg = $crawler->filter('#dpeCateg > strong');
$parsedHome->energy = $dpeCateg->count() === 1 ? $dpeCateg->text() : '';
// $parsedHome->city = ?
// $parsedHome->map = ?
$parsedHome->pictures = $crawler