I have a program (attached) that captured the main body of text from a document with the following code: $domObj = str_get_html( $document, true ); $domObj->find( 'br', 2 )->outertext = $domObj->find( 'br', 2 )->outertext . '<div id="wrapper">'; $domObj->find( 'hr', 0 )->outertext = '</div>' . $domObj->find( 'hr', 0 )->outertext; $document = $domObj->save(); $domObj->clear(); The main body of text is now enclosed with <div class="entry"> </div> I think I have to change the code to something like this but I need help with syntax: $domObj = str_get_html( $document, true ); $domObj->find( 'div class="entry"', 0 )->outertext = $domObj->find( 'div class="entry"', 0 )->outertext . '<div id="wrapper">'; $domObj->find( '/div', 0 )->outertext = '</div>' . $domObj->find( '/div', 0 )->outertext; $document = $domObj->save(); $domObj->clear(); I would appreciate any help!
$domObj = str_get_html( $document, true ); $domObj->find( 'div.entry', 0 )->outertext = $domObj->find( 'div.entry', 0 )->outertext . '<div class="entry">'; $domObj->find( '/div', 0 )->outertext = '</div>' . $domObj->find( '/div', 0 )->outertext; $document = $domObj->save(); $domObj->clear(); Maybe like this ?
maybe you can try $domObj->find( 'entry', 0 ) or some variation of that. ANd just replace everywhere you see div.entry with entry