I'm relatively new to php's HTMLDOMDocument class.
I'm doing something like this:
$html = getHTML();
$htmlDOM = new DOMDocument('5.0', 'utf-8');
libxml_use_internal_errors(true);
$htmlDOM->loadHTML(mb_convert_encoding(($html), 'HTML-ENTITIES', 'UTF-8'));
libxml_clear_errors();
Unfortunately all the elements that are retrieved has classes, not IDs. Retrieving elements by Id or Tags are pretty straightforward...
But, how do I retrieve a few elements inside with a specific class (eg: post-hover
) and then delete them from $htmlDOM
?