PHPHtmlParser\Dom\AbstractNode::find PHP Method

find() public method

Find elements by css selector
public find ( string $selector, integer $nth = null ) : array | AbstractNode
$selector string
$nth integer
return array | AbstractNode
    public function find($selector, $nth = null)
    {
        $selector = new Selector($selector);
        $nodes = $selector->find($this);
        if (!is_null($nth)) {
            // return nth-element or array
            if (isset($nodes[$nth])) {
                return $nodes[$nth];
            }
            return null;
        }
        return $nodes;
    }