Skip to content

Commit

Permalink
hotix #325 [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
Irfan committed Sep 16, 2020
1 parent 86146bd commit ca18a33
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/Parser/Top/TopListItemParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit ca18a33

Please sign in to comment.