I am trying to parse some html that is not on my server
$dom = new DOMDocument(); $dom->loadHTMLfile("http://www.some-site.org/page.aspx"); echo $dom->getElementById('his_id')->item(0);
but php returns an error something like ID his_id already defined in http://www.some-site.org/page.aspx, line: 33 . I think this is due to the fact that the DOMDocument is dealing with invalid html. So, how can I parse it, although this is not valid?
php html-parsing domdocument
kmunky
source share