ludo1960 Posted February 10, 2019 Share Posted February 10, 2019 Hi guys, I am usingĀ this dom parser, and its pretty easy to find all links on a page then following the links to sub pages, but how do I know when to stop, i.e.when the page has no more children? I came across this script for dealing with child pages, but needless to say it outputs nothing: $links = $html->find('div.layout'); foreach ($links as $link) { foreach ($link->children() as $children) { if ($children->tag == 'a') { $output [] = $children->plaintext; //or whatever you want } } } How do I test for a link that has no more children? Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.