public function extractLinksInfo(DomCrawler $crawler, Link $pageLink)
    {        
        $childLinks = array();
        $crawler->filter('a')->each(function (DomCrawler $node, $i) use (&$childLinks, $pageLink) {
            $nodeText = trim($node->html());               
            
            $href = $node->extract('href')[0];
            if(empty($href)===true){
                return;
            }
            $nodeLink = new Link($href,$pageLink);
            $nodeLink->addMetaInfo('linksText', $nodeText);
            
            $hash = $nodeLink->getAbsoluteUrl(false,false);
            if(isset($this->links[$hash]) === false){
                $childLinks[$hash] = $nodeLink;
            }
            
            
            $filterCallback = $this->filterCallback;
            if ($filterCallback && $filterCallback($hash) === false) {            
                $nodeLink->setAsShouldVisit(false);
                $this->log(LogLevel::INFO, 'skipping '.$hash. ' not matching filter criteira');
                return;
            }
        });


        return $childLinks;
    }
public function extractLinksInfo(DomCrawler $crawler, Link $pageLink)
    {        
        $childLinks = array();
        $crawler->filter('a')->each(function (DomCrawler $node, $i) use (&$childLinks, $pageLink) {
            $nodeText = trim($node->html());               
            
            $href = $node->extract('href')[0];
            if(empty($href)===true){
                return;
            }
            $nodeLink = new Link($href,$pageLink);
            $nodeLink->addMetaInfo('linksText', $nodeText);
            
            $hash = $nodeLink->getAbsoluteUrl(false,false);
            if(isset($this->links[$hash]) === false){
                $childLinks[$hash] = $nodeLink;
            }
            
            
            $filterCallback = $this->filterCallback;
            if ($filterCallback && $filterCallback($hash) === false) {            
                $nodeLink->setAsShouldVisit(false);
                $this->log(LogLevel::INFO, 'skipping '.$hash. ' not matching filter criteira');
                return;
            }
        });


        return $childLinks;
    }
public function extractLinksInfo ( DomCrawler $ crawler , Link $ pageLink ) { $ childLinks = array ( ) ; $ crawler -> filter ( 'a' ) -> each ( function ( DomCrawler $ node , $ i ) use ( & $ childLinks , $ pageLink ) { $ nodeText = trim ( $ node -> html ( ) ) ; $ href = $ node -> extract ( 'href' ) [ 0 ] ; if ( empty ( $ href ) === true ) { return ; } $ nodeLink = new Link ( $ href , $ pageLink ) ; $ nodeLink -> addMetaInfo ( 'linksText' , $ nodeText ) ; $ hash = $ nodeLink -> getAbsoluteUrl ( false , false ) ; if ( isset ( $ this -> links [ $ hash ] ) === false ) { $ childLinks [ $ hash ] = $ nodeLink ; } $ filterCallback = $ this -> filterCallback ; if ( $ filterCallback && $ filterCallback ( $ hash ) === false ) { $ nodeLink -> setAsShouldVisit ( false ) ; $ this -> log ( LogLevel :: INFO , 'skipping ' . $ hash . ' not matching filter criteira' ) ; return ; } } ) ; return $ childLinks ; }
Extract links information from url
@param  \Symfony\Component\DomCrawler\Crawler $crawler
@param Link $pageLink
Extract links information from url