Take a look at my post about HTML DOM here
We know Php DOM can get values, attributes of an HTML node and there are inbuilt functions for it, but is there any way to get just HTML content of the node?
Yes there is one such workaround which you can use to get the HTML content
Look at the below code
$htmlContent=file_get_contents("https://www.ramanean.com");
$content->loadHTML($htmlContent);
$divs= $content->getElementsByTagName('div');
foreach($divs as $div)
{
//HTML content of individual div is stored in $divHTML
$divHTML=$domStates->saveXML($div);
}