parent
a9ee66a2d4
commit
fc9bbd9e4d
@ -18,9 +18,13 @@ class OuestFrance extends Parser
|
||||
$crawler = new Crawler($body);
|
||||
$parsedHome = new ParsedHome();
|
||||
$parsedHome->title = $crawler->filter('h1')->text();
|
||||
$parsedHome->price = (int)str_replace(' ', '', $crawler->filter('#strongPrix')->text());
|
||||
$parsedHome->description = $crawler->filter('#blockonDescriptif')->text();
|
||||
$details = $crawler->filter('#blocCaractAnn > ul > li');
|
||||
$price = $crawler->filter('#strongPrix');
|
||||
if (!$price instanceof Crawler) {
|
||||
$price = $details->eq(0)->filter('strong')->text();
|
||||
}
|
||||
$parsedHome->price = (int)str_replace(' ', '', $price->text());
|
||||
$parsedHome->description = $crawler->filter('#blockonDescriptif')->text();
|
||||
$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());
|
||||
|
Loading…
Reference in New Issue
Block a user