public function matches($crawler): bool
    {
        $elements = $this->crawler($crawler)->filter($this->selector);

        if ($elements->count() == 0) {
            return false;
        }

        if (empty($this->attributes)) {
            return true;
        }

        $elements = $elements->reduce(function ($element) {
            return $this->hasAttributes($element);
        });

        return $elements->count() > 0;
    }