public function getHeaderText(): string
    {
        $header      = $this->getHeaderElement();
        $header_text = $header->getText();
        $header_link = $header->find('css', 'a');

        // The page headers can often include an 'add new link'. Strip that out of the header text.
        if ($header_link) {
            $header_text = trim(str_replace($header_link->getText(), '', $header_text));
        }

        return $header_text;
    }
public function getHeaderText(): string
    {
        $header      = $this->getHeaderElement();
        $header_text = $header->getText();
        $header_link = $header->find('css', 'a');

        // The page headers can often include an 'add new link'. Strip that out of the header text.
        if ($header_link) {
            $header_text = trim(str_replace($header_link->getText(), '', $header_text));
        }

        return $header_text;
    }
public function getHeaderText ( ) : string { $ header = $ this -> getHeaderElement ( ) ; $ header_text = $ header -> getText ( ) ; $ header_link = $ header -> find ( 'css' , 'a' ) ; // The page headers can often include an 'add new link'. Strip that out of the header text. if ( $ header_link ) { $ header_text = trim ( str_replace ( $ header_link -> getText ( ) , '' , $ header_text ) ) ; } return $ header_text ; }
Returns the text in the header tag.

The first h1 element is used, or first h2 element if it is not present.

@return string The text in the header tag.
Returns the text in the header tag .