Hey there,
I’m trying to wrap my head around getting all links from my pages for some experiments, and what I got so far is this:
foreach ($site->index()->limit(1) as $child) {
$dom = new \DOMDocument;
@$dom->loadHTML($child->render());
$links = $dom->getElementsByTagName('a');
foreach ($links as $link) {
dump($link->getAttribute('href'));
}
}
… but instead of storing the page’s HTML representation, it renders parts of the page and doesn’t output any links at all …