title: PHP parsing invalid html
body: <p>i'm trying to parse some html that is not on my server</p>
  
  <pre><code>    $dom = new DOMDocument();
      $dom-&gt;loadHTMLfile("http://www.some-site.org/page.aspx");      
      echo    $dom-&gt;getElementById('his_id')-&gt;item(0);
  </code></pre>
  
  <p>but php returns an error something like <code>ID his_id already defined in http://www.some-site.org/page.aspx, line: 33</code>. I think that is because DOMDocument is dealing with invalid html. So, how can i parse it even though is invalid?</p>