Fetch Content from A Div Class using PHP Simple HTML DOM Parser

dom, parsing, simple-html-dom

Solution

Under the Magic Attributes tab of How to access the HTML element's attributes, you'll find how to access an object's `innertext` property. There's also a `plaintext` property.

$es = $html->find('div[class="post"]', 0);
echo $es->innertext; // Some Content 

Problem

How to Fetch Content in A Div Class using PHP Simple HTML DOM Parser. Here i want to fetch content from a div class like: ``` <div class="post" imposition="usermanual">Some Content </div> ``` So, what is the way to fetch content using this div class `post`? I have tried this code but dont works: ``` $es = $html->find('.post'); $es = $html->find('div.post'); // also try this $es = $html->find('div[class="post"]'); // also try this ``` Any idea?

Original source