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
- remove divs class
bar
- 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
Post a Comment