How to get html source code from body field in node type edit form? In node type = &quot;article&quot;, I have field of type body.

In my .module file, I want to get its raw source code with actual html classes too. But all I get is:

$body = $node-&gt;get('field_all_body')-&gt;value;
print_r($body);die;

I want the value should contain div class too. How it can be achieved?
My actual requirement is:
I want to populate one field value on behalf of the class exists in 'field_all_body' field.
Foe example, I select some text in text-editor, and mark it bold, then that particular text should get cloned in another field too.
The basic text format filters out all but a few HTML tags.  You want to select the Full HTML text format to keep your divs and classes.