From f14358c7111fdfdeaecb3297e4dcaf4ad1169e42 Mon Sep 17 00:00:00 2001 From: Dominik Pfennig <dominik@suma-ev.de> Date: Tue, 12 Jul 2016 10:03:22 +0200 Subject: [PATCH] =?UTF-8?q?Wenn=20Bing=20beim=20Parsen=20der=20Ergebnissei?= =?UTF-8?q?te=20abst=C3=BCrzt,=20gibt=20es=20nun=20einfach=20ein=20leeres?= =?UTF-8?q?=20Ergebnis=20zur=C3=BCck?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Models/parserSkripte/Bing.php | 46 +++++++++++++++++-------------- 1 file changed, 26 insertions(+), 20 deletions(-) diff --git a/app/Models/parserSkripte/Bing.php b/app/Models/parserSkripte/Bing.php index 872aa4b66..74732ae86 100644 --- a/app/Models/parserSkripte/Bing.php +++ b/app/Models/parserSkripte/Bing.php @@ -16,27 +16,33 @@ class Bing extends Searchengine public function loadResults ($result) { - $crawler = new Crawler($result); - $crawler->filter('ol#b_results > li.b_algo')->each(function (Crawler $node, $i) + try { - $title = $node->filter('li h2 > a')->text(); - $link = $node->filter('li h2 > a')->attr('href'); - $anzeigeLink = $link; - $descr = $node->filter('li div > p')->text(); - - #die($result); - - $this->counter++; - $this->results[] = new \App\Models\Result( - $this->engine, - $title, - $link, - $anzeigeLink, - $descr, - $this->gefVon, - $this->counter - ); - } ); + $crawler = new Crawler($result); + $crawler->filter('ol#b_results > li.b_algo')->each(function (Crawler $node, $i) + { + $title = $node->filter('li h2 > a')->text(); + $link = $node->filter('li h2 > a')->attr('href'); + $anzeigeLink = $link; + $descr = $node->filter('li div > p')->text(); + + #die($result); + + $this->counter++; + $this->results[] = new \App\Models\Result( + $this->engine, + $title, + $link, + $anzeigeLink, + $descr, + $this->gefVon, + $this->counter + ); + } ); + } catch ( \ErrorException $e) + { + return; + } -- GitLab