Symfony\Component\DomCrawler\Crawler::nextAll PHP Method

nextAll() public method

Returns the next siblings nodes of the current selection.
public nextAll ( ) : Crawler
return Crawler A Crawler instance with the next sibling nodes
    public function nextAll()
    {
        if (!$this->nodes) {
            throw new \InvalidArgumentException('The current node list is empty.');
        }
        return $this->createSubCrawler($this->sibling($this->getNode(0)));
    }

Usage Example

 /**
  * @param Crawler $node
  *
  * @return array
  */
 protected function parse(Crawler $node)
 {
     $title = explode(' - ', $node->html());
     // Get the changes
     $nodes = $node->nextAll()->filterXPath('h3[preceding-sibling::h2[1][.="' . $node->html() . '"]]');
     $changes = (new ChangesRetriever($nodes))->retrieve();
     return ['name' => $title[0], 'date' => isset($title[1]) ? $title[1] : null, 'changes' => $changes];
 }
All Usage Examples Of Symfony\Component\DomCrawler\Crawler::nextAll