php - Simple Dom Parser - stripping links and specific divs from the result -


i trying parse content specific div , save external file. although works, couldn't manage following

from div class league_container

  1. remove divs class bar
  2. strip links. (leave text remove a plus attributes)

what have far is:

   <?php     include( 'simple_html_dom.php');      $html = file_get_html('https://some.domain.com/');      $divcontents = array();      foreach ($html->find('div.league_container') $div)      {         $divcontents[] = $div->outertext;     }          file_put_contents('parser/est-results.htm', implode(php_eol, $divcontents)); ?> 

any appreciated.

use outertext = :

$div->outertext = ''; $a->outertext = $a->text(); 

Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

inno setup - TLabel or TNewStaticText - change .Font.Style on Focus like Cursor changes with .Cursor -