I want to check if a website contains schema.org markup? I am doing the following:
$domain = 'http://agents.allstate.com/william-leahy-mount-prospect-il.html';
$client = new Zend_Http_Client();
$client->setUri($domain);
$response = $client->request();
$html = $response->getBody();
$dom = new Zend_Dom_Query($html);
$resultSchema = $dom->query('body');
foreach($resultSchema as $r){
$data = $r->hasAttribute('itemprop');
if($data)
echo 'YEs';
else
echo 'No';
}
I am not understanding how to find this. Is this the correct way of doing it? The schema.org markup used on the website may use any html element. How can i query all the elements and find one that contains the schema.org markup?