Skip to content
Snippets Groups Projects
Commit dc723827 authored by Dominik Hebeler's avatar Dominik Hebeler
Browse files

Fehler in Yandex behoben

parent bb8dca0f
No related branches found
No related tags found
1 merge request!751Fehler in Yandex behoben
...@@ -44,8 +44,7 @@ class Yandex extends Searchengine ...@@ -44,8 +44,7 @@ class Yandex extends Searchengine
); );
} }
} catch (\Exception $e) { } catch (\Exception $e) {
Log::error("A problem occurred parsing results from $this->name:"); Log::error("A problem occurred parsing results from $this->name:\n" . $e->getMessage() . "\n" . $result);
Log::error($e->getMessage());
return; return;
} }
} }
...@@ -58,8 +57,11 @@ class Yandex extends Searchengine ...@@ -58,8 +57,11 @@ class Yandex extends Searchengine
if (!$content) { if (!$content) {
return; return;
} }
$resultCount = $content->xpath('//yandexsearch/response/results/grouping/found[@priority="all"]');
$resultCount = intval($content->xpath('//yandexsearch/response/results/grouping/found[@priority="all"]')[0]->__toString()); if(!$resultCount || sizeof($resultCount) <= 0){
return;
}
$resultCount = intval($resultCount[0]->__toString());
$pageLast = $content->xpath('//yandexsearch/response/results/grouping/page')[0]; $pageLast = $content->xpath('//yandexsearch/response/results/grouping/page')[0];
$pageLast = intval($pageLast["last"]->__toString()); $pageLast = intval($pageLast["last"]->__toString());
if (count($this->results) <= 0 || $pageLast >= $resultCount) { if (count($this->results) <= 0 || $pageLast >= $resultCount) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment