Maybe this is a stupid question but I need to get an Object with all HTML nodes from a selected html Page. I have to make all nodes selectable, especially the opening tags. If anyone know the template Engine from TYPO3 TemplaVoila; I think this suits it best but I would like to rebuilt it by myself but I don't have any Idea how to get all opening Tags into an Object.
If anyone can push some Details, actually, I'm testing around with domCrawler like this but it is a bit confusing....
foreach ($crawler as $domElement) {
foreach ($domElement as $test){
var_dump($test->nodeName);
}
var_dump($domElement);
$html .= $domElement->ownerDocument->saveHTML($domElement);
}
So after some research, I am unsing HTMLPageDom and use it like that:
$css= new HtmlPage();
$css = new HtmlPage($head);
$cssNew = $css->filter('link')->each(function ($node) {
$node= $node->attr('href');
return $node;
});
So this works more or less but I'm thinking that I missunderstood something. How can I append data to $node->attr('href)? With:
$node->attr('href')->append('data in front of linkuri');