diff --git a/src/Parser/User/Profile/AnimeStatsParser.php b/src/Parser/User/Profile/AnimeStatsParser.php index 81680924..15547c40 100644 --- a/src/Parser/User/Profile/AnimeStatsParser.php +++ b/src/Parser/User/Profile/AnimeStatsParser.php @@ -63,6 +63,16 @@ public function getDaysWatched(): ?float */ public function getMeanScore(): ?float { + $node = $this->crawler + ->filterXPath( + '//*[@id="statistics"]/div[contains(@class, "user-statistics-stats")][1] + /div[contains(@class, "stats anime")]/div[1]/div[2]/span[contains(@class, "score-label")]' + ); + + if ($node->count()) { + return (float) $node->text(); + } + $node = $this->crawler ->filterXPath('//div[@class=\'di-tc ar pr8 fs12 fw-b\'][1]'); diff --git a/src/Parser/User/Profile/MangaStatsParser.php b/src/Parser/User/Profile/MangaStatsParser.php index 224c45f1..34339935 100644 --- a/src/Parser/User/Profile/MangaStatsParser.php +++ b/src/Parser/User/Profile/MangaStatsParser.php @@ -63,6 +63,16 @@ public function getDaysRead(): ?float */ public function getMeanScore(): ?float { + $node = $this->crawler + ->filterXPath( + '//*[@id="statistics"]/div[contains(@class, "user-statistics-stats")][2] + /div[contains(@class, "stats manga")]/div[1]/div[2]/span[contains(@class, "score-label")]' + ); + + if ($node->count()) { + return (float) $node->text(); + } + $node = $this->crawler ->filterXPath('//div[@class=\'di-tc ar pr8 fs12 fw-b\'][2]');