Lopezito
Eta
Diseñador
Verificación en dos pasos activada
Buenas
Estoy tratando de leer una web y sustraer parte del contenido, en este caso para testear use Google:
Pero me tira los siguientes errores:
Estoy tratando de leer una web y sustraer parte del contenido, en este caso para testear use Google:
PHP:
<?php
$doc = new DomDocument;
$doc->validateOnParse = true;
$doc->loadHtml(file_get_contents('http://google.com/'));
$footer = $doc->getElementById('footer');
var_dump($doc->getElementById('footer'));
?>
Pero me tira los siguientes errores:
Insertar CODE, HTML o PHP:
Warning: DOMDocument::loadHTML() [domdocument.loadhtml]: htmlParseEntityRef: expecting ';' in Entity, line: 41 in /home/user/public_html/index.php on line 4
Warning: DOMDocument::loadHTML() [domdocument.loadhtml]: htmlParseEntityRef: expecting ';' in Entity, line: 41 in /home/user/public_html/index.php on line 4
Warning: DOMDocument::loadHTML() [domdocument.loadhtml]: htmlParseEntityRef: expecting ';' in Entity, line: 41 in /home/user/public_html/index.php on line 4
Warning: DOMDocument::loadHTML() [domdocument.loadhtml]: htmlParseEntityRef: expecting ';' in Entity, line: 41 in /home/user/public_html/index.php on line 4
Warning: DOMDocument::loadHTML() [domdocument.loadhtml]: htmlParseEntityRef: expecting ';' in Entity, line: 41 in /home/user/public_html/index.php on line 4
Warning: DOMDocument::loadHTML() [domdocument.loadhtml]: htmlParseEntityRef: expecting ';' in Entity, line: 41 in /home/user/public_html/index.php on line 4
Warning: DOMDocument::loadHTML() [domdocument.loadhtml]: htmlParseEntityRef: expecting ';' in Entity, line: 41 in /home/user/public_html/index.php on line 4
Warning: DOMDocument::loadHTML() [domdocument.loadhtml]: htmlParseEntityRef: expecting ';' in Entity, line: 41 in /home/user/public_html/index.php on line 4
Warning: DOMDocument::loadHTML() [domdocument.loadhtml]: htmlParseEntityRef: expecting ';' in Entity, line: 41 in /home/user/public_html/index.php on line 4
Warning: DOMDocument::loadHTML() [domdocument.loadhtml]: htmlParseEntityRef: expecting ';' in Entity, line: 41 in /home/user/public_html/index.php on line 4
Warning: DOMDocument::loadHTML() [domdocument.loadhtml]: htmlParseEntityRef: expecting ';' in Entity, line: 41 in /home/user/public_html/index.php on line 4
Warning: DOMDocument::loadHTML() [domdocument.loadhtml]: htmlParseEntityRef: expecting ';' in Entity, line: 41 in /home/user/public_html/index.php on line 4
Warning: DOMDocument::loadHTML() [domdocument.loadhtml]: htmlParseEntityRef: expecting ';' in Entity, line: 41 in /home/user/public_html/index.php on line 4
Warning: DOMDocument::loadHTML() [domdocument.loadhtml]: htmlParseEntityRef: no name in Entity, line: 41 in /home/user/public_html/index.php on line 4
Warning: DOMDocument::loadHTML() [domdocument.loadhtml]: htmlParseEntityRef: expecting ';' in Entity, line: 41 in /home/user/public_html/index.php on line 4
object(DOMElement)#2 (17) { ["tagName"]=> string(4) "span" ["schemaTypeInfo"]=> NULL ["nodeName"]=> string(4) "span" ["nodeValue"]=> string(107) "Advertentieprogramma'sBedrijfsoplossingen+GoogleAlles over GoogleGoogle.com© 2013 - Privacy en voorwaarden" ["nodeType"]=> int(1) ["parentNode"]=> string(22) "(object value omitted)" ["childNodes"]=> string(22) "(object value omitted)" ["firstChild"]=> string(22) "(object value omitted)" ["lastChild"]=> string(22) "(object value omitted)" ["previousSibling"]=> string(22) "(object value omitted)" ["attributes"]=> string(22) "(object value omitted)" ["ownerDocument"]=> string(22) "(object value omitted)" ["namespaceURI"]=> NULL ["prefix"]=> string(0) "" ["localName"]=> string(4) "span" ["baseURI"]=> NULL ["textContent"]=> string(107) "Advertentieprogramma'sBedrijfsoplossingen+GoogleAlles over GoogleGoogle.com© 2013 - Privacy en voorwaarden" }

