Crawler.php
public function link($method = 'get')
    {
        if (!$this->nodes) {
            throw new \InvalidArgumentException('The current node list is empty.');
        }

        $node = $this->getNode(0);

        if (!$node instanceof \DOMElement) {
            throw new \InvalidArgumentException(sprintf('The selected node should be instance of DOMElement, got "%s".', get_class($node)));
        }

        return new Link($node, $this->baseHref, $method);
    }
public function link($method = 'get')
    {
        if (!$this->nodes) {
            throw new \InvalidArgumentException('The current node list is empty.');
        }

        $node = $this->getNode(0);

        if (!$node instanceof \DOMElement) {
            throw new \InvalidArgumentException(sprintf('The selected node should be instance of DOMElement, got "%s".', get_class($node)));
        }

        return new Link($node, $this->baseHref, $method);
    }
public function link ( $ method = 'get' ) { if ( ! $ this -> nodes ) { throw new \ InvalidArgumentException ( 'The current node list is empty.' ) ; } $ node = $ this -> getNode ( 0 ) ; if ( ! $ node instanceof \ DOMElement ) { throw new \ InvalidArgumentException ( sprintf ( 'The selected node should be instance of DOMElement, got "%s".' , get_class ( $ node ) ) ) ; } return new Link ( $ node , $ this -> baseHref , $ method ) ; }
Returns a Link object for the first node in the list.

@param string $method The method for the link (get by default)

@return Link A Link instance

@throws \InvalidArgumentException If the current node list is empty or the selected node is not instance of DOMElement
Returns a Link object for the first node in the list .