src/Crawler/AdCrawler.php
public function getPictures(Crawler $node = null)
    {
        $node = $node ?: $this->node;

        $images = [
            'images_thumbs' => [],
            'images'        => [],
        ];

        $node
            ->filter('.adview_main script')
            ->each(function (Crawler $crawler) use (&$images) {
                if (preg_match_all(
                    '#//img.+.leboncoin.fr/.*\.jpg#',
                    $crawler->html(),
                    $matches
                )) {
                    foreach ($matches[0] as $image) {
                        if (preg_match('/thumb/', $image)) {
                            array_push(
                                $images['images_thumbs'],
                                (string) Http::createFromString($image)
                                    ->withScheme($this->sheme)
                            );

                            continue;
                        }

                        array_push(
                            $images['images'],
                            (string) Http::createFromString($image)
                                ->withScheme($this->sheme)
                        );
                    }
                }
            });

        return $images;
    }
public function getPictures(Crawler $node = null)
    {
        $node = $node ?: $this->node;

        $images = [
            'images_thumbs' => [],
            'images'        => [],
        ];

        $node
            ->filter('.adview_main script')
            ->each(function (Crawler $crawler) use (&$images) {
                if (preg_match_all(
                    '#//img.+.leboncoin.fr/.*\.jpg#',
                    $crawler->html(),
                    $matches
                )) {
                    foreach ($matches[0] as $image) {
                        if (preg_match('/thumb/', $image)) {
                            array_push(
                                $images['images_thumbs'],
                                (string) Http::createFromString($image)
                                    ->withScheme($this->sheme)
                            );

                            continue;
                        }

                        array_push(
                            $images['images'],
                            (string) Http::createFromString($image)
                                ->withScheme($this->sheme)
                        );
                    }
                }
            });

        return $images;
    }
public function getPictures ( Crawler $ node = null ) { $ node = $ node ? : $ this -> node ; $ images = [ 'images_thumbs' => [ ] , 'images' => [ ] , ] ; $ node -> filter ( '.adview_main script' ) -> each ( function ( Crawler $ crawler ) use ( & $ images ) { if ( preg_match_all ( '#//img.+.leboncoin.fr/.*\.jpg#' , $ crawler -> html ( ) , $ matches ) ) { foreach ( $ matches [ 0 ] as $ image ) { if ( preg_match ( '/thumb/' , $ image ) ) { array_push ( $ images [ 'images_thumbs' ] , ( string ) Http :: createFromString ( $ image ) -> withScheme ( $ this -> sheme ) ) ; continue ; } array_push ( $ images [ 'images' ] , ( string ) Http :: createFromString ( $ image ) -> withScheme ( $ this -> sheme ) ) ; } } } ) ; return $ images ; }
Return an array with the Thumbs pictures url

@param Crawler $node
@return array
Return an array with the Thumbs pictures url