I am trying to get the following text "Huggies Pure Baby Wipes 4 x 64 per pack" shown in the code below.
<div class="offerList-item-description-title">
<div id="result-title-5" class="offerList-item-description-title">
<script type="text/javascript">
document.write(getContents('wF8UD9Jj8:6D !FC6 q23J (:A6D c I ec A6C A24\<'));
</script>Huggies Pure Baby Wipes 4 x 64 per pack
</div>
</div>
I have tried using code such as:
foreach($element -> find('.offerList-item-description-title') as $title)
{
foreach($element -> find('text') as $text){
echo $text;
}
}
But just get returned an empty string, any suggestions?
Thanks.
$element -> find('text')is your problem. There is notexttag. I would think that instead of the secondforeachyou'd want something like$title->innertext