title: Problem with iterating throught DOM using DOMDocument
body: <p>I have html with such structure:</p>
  
  <pre><code>&lt;div id="info"&gt;
       &lt;h1&gt;Some text&lt;/h1&gt;
  &lt;/div&gt;
  &lt;div class="box_con"&gt;
      &lt;div id="list"&gt;
          &lt;dl&gt;
              &lt;dt&gt;《Library of Heaven“s Path》 Volume 1&lt;/dt&gt;
              &lt;dd&gt; &lt;a style="" href="1300359.html"&gt;1 Swindler&lt;/a&gt;&lt;/dd&gt;
          &lt;/dl&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>This is my code:</p>
  
  <pre><code>$doc = new DOMDocument;
  @$doc-&gt;loadHTMLFile($url);
  $volume_titles = [];
  $title = $doc-&gt;getElementById('info')-&gt;childNodes-&gt;item(1)-&gt;nodeValue;
  $volume_list = $doc-&gt;getElementById('list')-&gt;getElementsByTagName('dl');
  </code></pre>
  
  <p>And I dont know how to iterate this <code>dl</code> element to retrieve <code>&lt;a&gt;</code> href and content. I have already tried a lot of loops.</p>
  
  <pre><code>    $el = $volume_list-&gt;firstChild;
      do {
          var_dump($el);
      } while ($el = $el-&gt;nextSibling);
  
  
  
      $length = $volume_list-&gt;length;
      for ($i = 0; $i &lt; $length; $i++) {
          $node = $volume_list-&gt;childNodes-&gt;item($i);
          var_dump($node);
          die();
      }
  
  
          foreach ($volume_list-&gt;childNodes as $volume) {
          //var_dump($volume_list-&gt;getElementsByTagName('dd')-&gt;item(0)-&gt;nodeValue);
          var_dump($volume);
          die();
      }
  </code></pre>
  
  <p>But nothing works</p>