Commit 52821444 authored by Dominik Hebeler's avatar Dominik Hebeler
Browse files

Wenn Bing beim Parsen der Ergebnisseite abstürzt, gibt es nun einfach ein leeres Ergebnis zurück

parent 32133fef
......@@ -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;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment