Skip to content

Commit

Permalink
ProducerParser: bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
irfan-dahir committed Jul 27, 2022
1 parent 32e6888 commit 405f5f5
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/Parser/Producer/ProducerParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,9 @@ function (Crawler $animeCrawler) {
*/
public function getUrl(): Model\Common\MalUrl
{
$title = $this->crawler->filterXPath('//*[@id="contentWrapper"]/div[1]/h1');
return new Model\Common\MalUrl(
JString::cleanse(
Parser::removeChildNodes($this->crawler->filterXPath('//span[@class=\'di-ib mt4\']'))->text()
),
$title->text(),
$this->crawler->filterXPath('//meta[@property="og:url"]')->attr('content')
);
}
Expand Down Expand Up @@ -209,7 +208,7 @@ public function getFavorites(): ?int
*/
public function getAnimeCount(): int
{
$node = $this->crawler->filterXPath('//*[@id="content"]/div[2]/div[6]/div/ul/li[1]');
$node = $this->crawler->filterXPath('//*[@id="content"]/div[2]/div[contains(@class, "navi-seasonal")]/div/ul/li[1]');

preg_match('~\((.*)\)~', $node->text(), $matches);

Expand Down

0 comments on commit 405f5f5

Please sign in to comment.