Crawler not working

Hi , i want to make crawler to get some data from url , but when i executed this code:

$url = ‘’;

$dom = new \DOMDocument;


$rows = $dom->getElementsByTagName(‘tr’);

foreach($rows as $row){

   $tmp[] = $row;


Give me this error : "DOMDocument::load( failed to open stream: HTTP request failed! HTTP/1.1 416 Requested Range Not Satisfiable"


Hi mcirkova,

Hope Doing well,

The problem is the crawling url is not a document object then it will return error so adding @ to the beginning of your loadHTMLFile($url) function will help you.

Please find below for modified code

 $url = '';

        $dom = new \DOMDocument;

        $success = @$dom->loadHTMLFile($url);

        $tmp = [];

        if ($success) {

            $rows = $dom->getElementsByTagName('tr');

            foreach ($rows as $row) {

                $tmp[] = $row;




Happy Coding.