¿Pero esperabas que te hiciéramos la tarea?
¿Probaste algo como esto?
Código PHP:
Ver original$dom = new DOMDocument();
@$dom->loadHTML($html);
// grab all the on the page
$xpath = new DOMXPath($dom);
$hrefs = $xpath->evaluate("/html/body//a");
for ($i = 0; $i < $hrefs->length; $i++) {
$href = $hrefs->item($i);
$urls[] = $href->getAttribute('href');
}
No sé como funciona aquella librería. No sé si el método getAttribute devuelve todos los 'href', o el primero que encuentre. Si lo meto dentro de un ciclo for, ¿realmente estaré recorriendo todos los href?...