Hello good day I am trying to scrape an xml feed that was given to us, I am using simple htmldom to scrape it but some contents have cdata, how can I remove it?
<date>
<weekday>
<![CDATA[ Friday
]]>
</weekday>
</date>
php
<?php
<?php
include('simple_html_dom.php');
include ('phpQuery.php');
if (ini_get('allow_url_fopen'))
$xml = file_get_html('http://www.link.com/url.xml'); }
else{ $ch = curl_init('http://www.link.com/url.xml');
curl_setopt ($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$src = curl_exec($ch);
$xml = str_get_html($src, false); }
?>
<?php
foreach($xml->find('weekday') as $e)
echo $e->innertext . '<br>';
?>
I believe by default simplehtmldom removes the cdata but for some reason it doesn't work.
Kindly tell me if you need any info that would be helpful to solve this issue
Thank you so much for your help