savj14 Posted May 7, 2014 Share Posted May 7, 2014 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> Quote Link to comment Share on other sites More sharing options...
savj14 Posted May 8, 2014 Author Share Posted May 8, 2014 Anyone out there? =) Quote Link to comment Share on other sites More sharing options...
Ch0cu3r Posted May 8, 2014 Share Posted May 8, 2014 Try $url = file_get_html('http://website.com'); $text1 = $dom->find('div[class="ym-gl headingInnerDiv"] a', 0); $text2 = $dom->find('div[class="ym-grid ym-gl"] p', 0); echo "Text1: {$text1->innertext}<br />Text2: {$text2->innertext}"; Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.