index.js
function crawlHref($,result, a, callback) {

      var link = $(a).attr('href');
      var parentUrl = result.url;
      if (link) {

        var anchor = $(a).text() ? $(a).text() : "";
        var noFollow = $(a).attr("rel");
        var isDoFollow =  ! (noFollow && noFollow === "nofollow");

        var linkUri = URI.linkToURI(parentUrl, link);

        pm.crawlLink(parentUrl, linkUri, anchor, isDoFollow, function(){
          addLinkToQueue(result, parentUrl, linkUri, anchor, isDoFollow, callback);
        });

      }
      else {
        callback();
      }

}
function crawlHref($,result, a, callback) {

      var link = $(a).attr('href');
      var parentUrl = result.url;
      if (link) {

        var anchor = $(a).text() ? $(a).text() : "";
        var noFollow = $(a).attr("rel");
        var isDoFollow =  ! (noFollow && noFollow === "nofollow");

        var linkUri = URI.linkToURI(parentUrl, link);

        pm.crawlLink(parentUrl, linkUri, anchor, isDoFollow, function(){
          addLinkToQueue(result, parentUrl, linkUri, anchor, isDoFollow, callback);
        });

      }
      else {
        callback();
      }

}
function crawlHref ( $ , result , a , callback ) { var link = $ ( a ) . attr ( 'href' ) ; var parentUrl = result . url ; if ( link ) { var anchor = $ ( a ) . text ( ) ? $ ( a ) . text ( ) : "" ; var noFollow = $ ( a ) . attr ( "rel" ) ; var isDoFollow = ! ( noFollow && noFollow === "nofollow" ) ; var linkUri = URI . linkToURI ( parentUrl , link ) ; pm . crawlLink ( parentUrl , linkUri , anchor , isDoFollow , function ( ) { addLinkToQueue ( result , parentUrl , linkUri , anchor , isDoFollow , callback ) ; } ) ; } else { callback ( ) ; } }
Extract info of ahref & send the info to the plugins


@param The HTML body containing the link (Cheerio wraper)
@param The http response with the crawl options
@param The anchor tag
@param callback()
Extract info of ahref & send the info to the plugins