Get next post page url

I want to get the next post page url

Example <– this post has the next page link

but I don’t want to continue. I want the crawler to stop when the path change

This is the current code

$attr = isset($nextPageSelector["attr"]) && $nextPageSelector["attr"] ? $nextPageSelector["attr"] : "href";
            if ($nextPageUrl = $this->extractData($this->crawler, $nextPageSelector["selector"], $attr, false, true, true)) {

                $this->postData->setNextPageUrl(Utils::prepareUrl($this->getSiteUrl(), $nextPageUrl, $this->postUrl));

Read more here: Get next post page url

Leave a Reply

Your email address will not be published. Required fields are marked *