From ca18a33cee6bb48331aeb27d583883629f3d5e81 Mon Sep 17 00:00:00 2001 From: Irfan Date: Wed, 16 Sep 2020 12:24:26 +0500 Subject: [PATCH] hotix #325 [ci skip] --- src/Parser/Top/TopListItemParser.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/Parser/Top/TopListItemParser.php b/src/Parser/Top/TopListItemParser.php index 89e5651f..83bc96f1 100644 --- a/src/Parser/Top/TopListItemParser.php +++ b/src/Parser/Top/TopListItemParser.php @@ -43,15 +43,22 @@ public function __construct(Crawler $crawler) */ public function getMalUrl(): MalUrl { - // For Anime/Manga - $node = $this->crawler->filterXPath('//td[contains(@class, "title")]/a'); + // For Anime + $node = $this->crawler->filterXPath('//td[contains(@class, "title")]/div/div/h3/a'); + + if ($node->count()) { + return (new MalUrlParser($node))->getModel(); + } + + // For Manga + $node = $this->crawler->filterXPath('//td[contains(@class, "title")]/div/h3/a'); if ($node->count()) { return (new MalUrlParser($node))->getModel(); } // For Characters/People - $node = $this->crawler->filterXPath('//td[contains(@class, "people")]/a'); + $node = $this->crawler->filterXPath('//td[contains(@class, "people")]/div/a'); if ($node->count()) { return (new MalUrlParser($node))->getModel();