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

// Get next page URL of the post   foreach($postNextPageUrlSelectors as $nextPageSelector) {   $attr = isset($nextPageSelector["attr"]) && $nextPageSelector["attr"] ? $nextPageSelector["attr"] : "href";   if ($nextPageUrl = $this->extractData($this->crawler $nextPageSelector["selector"] $attr