0

I am trying to parse this HTML

<div id="id1">
  <div id="subclass"> TEXT1 </div>
</div>

<div id="id2">
  <div class="subclass"> TEXT2 </div>
</div>

<div class="class1 ">
  <div class="subclass"> TEXT3 </div>
</div>

this is view page. I want to search id1 to class1(that div id="id1" to div class="class1" to find). I am Trying like this

foreach($html->find('div#subclass-single>div.class1 a') as $e){
    echo $e->href . '<br>';
}
Karthick Kumar
  • 77
  • 1
  • 12
  • possible duplicate of [PHP Simple HTML DOM Parser: Select only DIVs with multiple classes](http://stackoverflow.com/questions/14264525/php-simple-html-dom-parser-select-only-divs-with-multiple-classes) – Saty May 20 '15 at 06:09
  • I need between two div class or id. you say two different class.... – Karthick Kumar May 20 '15 at 06:11
  • @Karthick Kumar If all divs are on the same level go to next by next_sibling () untill
    – splash58 May 20 '15 at 08:46

0 Answers0