paquettg / php-html-parser

An HTML DOM parser. It allows you to manipulate HTML. Find tags on an HTML page with selectors just like jQuery.
MIT License
2.37k stars 461 forks source link

getting raw html from getElementsByTag #271

Closed handhikadj closed 3 years ago

handhikadj commented 3 years ago
$dom = new Dom();
        $dom->loadStr($str);

        $imgTags = $dom->getElementsByTag('img');
        foreach ($imgTags as $imgTag) {
            dump($imgTag); // <-- Laravel's dump
        }

I can't find a way to get the raw html of each tag

handhikadj commented 3 years ago

solved. using outerHtml