protected function findByNameOrId($name, $element = '*')
    {
        $name = str_replace('#', '', $name);

        try {
            return $this->session->element('css selector', "#{$name}, *[name={$name}]");
        } catch (NoSuchElement $e) {
            throw new InvalidArgumentException(
                "Couldn't find an element, '{$element}', with a name or class attribute of '{$name}'."
            );
        }
    }
protected function findByNameOrId($name, $element = '*')
    {
        $name = str_replace('#', '', $name);

        try {
            return $this->session->element('css selector', "#{$name}, *[name={$name}]");
        } catch (NoSuchElement $e) {
            throw new InvalidArgumentException(
                "Couldn't find an element, '{$element}', with a name or class attribute of '{$name}'."
            );
        }
    }
protected function findByNameOrId ( $ name , $ element = '*' ) { $ name = str_replace ( '#' , '' , $ name ) ; try { return $ this -> session -> element ( 'css selector' , "#{$name}, *[name={$name}]" ) ; } catch ( NoSuchElement $ e ) { throw new InvalidArgumentException ( "Couldn't find an element, '{$element}', with a name or class attribute of '{$name}'." ) ; } }
Filter according to an element's name or id attribute.

@param  string $name
@param  string $element
@return Crawler
Filter according to an element s name or id attribute .