Beispiel #1
0
 public static function scrapDetailPromoWithId($id)
 {
     $promo = Promo::findOrNew($id);
     $client = new Client();
     $scraper = $client->request('GET', $promo->url);
     $result = null;
     $scraper->filter('p')->each(function (Crawler $node) use(&$result) {
         if (strpos(strtolower($node->html()), '<strong>serbapromosi.co') !== false) {
             $result = $node->text();
         }
     });
     return $result;
 }