SImple HTML DOM parser not parsing <body> tag

Viewed 1450

I am using this simple_html_dom parser to try and parse an external url. I am able to use it correctly on most pages.

However when I try to parse the website http://talksport.com/football/atletico-madrid-beat-arsenal-and-west-ham-signing-portuguese-wonderkid-diogo-jota

the parser is not recognizing the <body> tag in the html.

require 'simple_html_dom.php';

$html = file_get_html('http://talksport.com/football/atletico-madrid-beat-arsenal-and-west-ham-signing-portuguese-wonderkid-diogo-jota');

// Find any tag for eg. <div>
$tag = $html->find('div',0);
var_dump($tag);

I get null as the result.

I tried to figure out why this is happening and found that

$x = $html->find('html',0)->children();

$x has only one child which is the <head> tag. The <body> tag is not parsed at all.

Anyone come across such an issue before? Please help.

2 Answers
Related