Jump to content

Helping parsing within DIVS


savj14

Recommended Posts

I'm trying to parse out TEXT #1 and TEXT #2 from the example below and I'm having issues. I've been using Simple HTML DOM parser but I seem to be missing something. I've tried different combinations like below but again no luck.

 

$url = file_get_html('http://website.com');

$text1 = $url->find('div.ym-gl.headingInnerDiv');

$text2 = $url->find('div.ym-grid.ym-gl');

<div class="ym-gl headingInnerDiv">
<a href="">TEXT #1</a>
</div>


<div class="ym-grid ym-gl" >
<a href=""></a>
<p style="font-size: 115%; margin-bottom:0px">TEXT #2</p>                                      
</div>
Link to comment
https://forums.phpfreaks.com/topic/288314-helping-parsing-within-divs/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.