diff --git a/app/Models/parserSkripte/Minisucher.php b/app/Models/parserSkripte/Minisucher.php index f7838b814c11a3830468653ea66af56a94f73db6..2b42f8dca3322814bd4cddd803aebfada4b8ec3a 100644 --- a/app/Models/parserSkripte/Minisucher.php +++ b/app/Models/parserSkripte/Minisucher.php @@ -30,28 +30,33 @@ class Minisucher extends Searchengine $counter = 0; foreach($results as $result) { - $counter++; - $result = simplexml_load_string($result->saveXML()); - $title = $result->xpath('//doc/arr[@name="title"]/str')[0]->__toString(); - $link = $result->xpath('//doc/str[@name="url"]')[0]->__toString(); - $anzeigeLink = $link; - $descr = ""; - $descriptions = $content->xpath("//response/lst[@name='highlighting']/lst[@name='$link']/arr[@name='content']/str"); - foreach($descriptions as $description) + try{ + $counter++; + $result = simplexml_load_string($result->saveXML()); + $title = $result->xpath('//doc/arr[@name="title"]/str')[0]->__toString(); + $link = $result->xpath('//doc/str[@name="url"]')[0]->__toString(); + $anzeigeLink = $link; + $descr = ""; + $descriptions = $content->xpath("//response/lst[@name='highlighting']/lst[@name='$link']/arr[@name='content']/str"); + foreach($descriptions as $description) + { + $descr .= $description->__toString(); + } + $descr = strip_tags($descr); + $provider = $result->xpath('//doc/str[@name="subcollection"]')[0]->__toString(); + $this->results[] = new \App\Models\Result( + $this->engine, + $title, + $link, + $link, + $descr, + $this->gefVon, + $counter + ); + }catch(\ErrorException $e) { - $descr .= $description->__toString(); + continue; } - $descr = strip_tags($descr); - $provider = $result->xpath('//doc/str[@name="subcollection"]')[0]->__toString(); - $this->results[] = new \App\Models\Result( - $this->engine, - $title, - $link, - $link, - $descr, - $this->gefVon, - $counter - ); }