1

I'm using DOMDocument class to parse elements but this class is returning error:

DOMDocument::loadHTML():Tag footer invalid in Entity

and is unable to parse webpage.

I'm using following script:

function getIpDetails( $address )
    {

        $ch = curl_init();

        curl_setopt($ch, CURLOPT_URL, $address);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_USERAGENT,'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13');

        $output = curl_exec($ch);
        curl_close($ch);

        $dom = new DOMDocument;
        $dom->loadHTML($output);

        ...
        ...
        ...

    }

footer is this html code:

<footer>
<div id="foot_section">
    <div id="foot_inner">
    <div id="foot_copy">All Rights Reserved.</div>
    <div id="foot_menu">
        <ul>
            <li>></li>
            <li></li>
            <li></li>
            <li></li>
            <li></li>
        </ul>
    </div>
    </div>
</div>
</footer>
Atur
  • 1,712
  • 6
  • 32
  • 42
DolDurma
  • 15,753
  • 51
  • 198
  • 377

0 Answers0