Hola
Estuve usando simple_html_dom.php, para parcear un html, pero no funciona el file_get_html
Estuve haciendo esta prueba
Código:
<?php
include("simplehtmldom_1_5/simple_html_dom.php");
// Create DOM from URL
$html = file_get_html('http://google.com');
// Find all article blocks
foreach($html->find('div.article') as $article) {
$item['title'] = $article->find('div.title', 0)->plaintext;
$item['intro'] = $article->find('div.intro', 0)->plaintext;
$item['details'] = $article->find('div.details', 0)->plaintext;
$articles[] = $item;
}
print_r($articles);
?>
Pero me salen estos errores:
Warning: file_get_contents(): stream does not support seeking in
Warning: file_get_contents(): Failed to seek to position -1 in the stream in ...line 75
Fatal error: Uncaught Error: Call to a member function find() on boolean...
Ent. se me ocurrio usar:
$html = file_get_contents('http://google.com');
echo $html;
obtengo el HTML, pero yo quiero obtener algunos Div en particular (y sus hijos) ¿como puedo saber donde termina ese Div? asi uso alguna funcion de manejo de String y obtengo la porcion del html que necesito
Gracias.-