Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Crawler.php

function Crawler::nodeName

Returns the node name of the first node of the list.

Throws

\InvalidArgumentException When current node is empty

File

vendor/symfony/dom-crawler/Crawler.php, line 528

Class

Crawler
Crawler eases navigation of a list of \DOMNode objects.

Namespace

Symfony\Component\DomCrawler

Code

public function nodeName() : string {
    if (!$this->nodes) {
        throw new \InvalidArgumentException('The current node list is empty.');
    }
    return $this->getNode(0)->nodeName;
}
RSS feed
Powered by Drupal