private boolean parseSource(HttpMessage message,Source source,int depth,String baseURL){
  log.debug("Parsing an HTML message...");
  boolean resourcesfound=false;
  List<Element> elements=source.getAllElements(HTMLElementName.A);
  for (  Element el : elements) {
    resourcesfound|=processAttributeElement(message,depth,baseURL,el,"href");
  }
  elements=source.getAllElements(HTMLElementName.AREA);
  for (  Element el : elements) {
    resourcesfound|=processAttributeElement(message,depth,baseURL,el,"href");
  }
  elements=source.getAllElements(HTMLElementName.FRAME);
  for (  Element el : elements) {
    resourcesfound|=processAttributeElement(message,depth,baseURL,el,"src");
  }
  elements=source.getAllElements(HTMLElementName.IFRAME);
  for (  Element el : elements) {
    resourcesfound|=processAttributeElement(message,depth,baseURL,el,"src");
  }
  elements=source.getAllElements(HTMLElementName.LINK);
  for (  Element el : elements) {
    resourcesfound|=processAttributeElement(message,depth,baseURL,el,"href");
  }
  elements=source.getAllElements(HTMLElementName.SCRIPT);
  for (  Element el : elements) {
    resourcesfound|=processAttributeElement(message,depth,baseURL,el,"src");
  }
  elements=source.getAllElements(HTMLElementName.IMG);
  for (  Element el : elements) {
    resourcesfound|=processAttributeElement(message,depth,baseURL,el,"src");
  }
  elements=source.getAllElements(HTMLElementName.META);
  for (  Element el : elements) {
    String equiv=el.getAttributeValue("http-equiv");
    String content=el.getAttributeValue("content");
    if (equiv != null && content != null) {
      if (equiv.equalsIgnoreCase("refresh") || equiv.equalsIgnoreCase("location")) {
        Matcher matcher=urlPattern.matcher(content);
        if (matcher.find()) {
          String url=matcher.group(1);
          processURL(message,depth,url,baseURL);
          resourcesfound=true;
        }
      }
    }
  }
  return resourcesfound;
}

private boolean parseSource ( HttpMessage message , Source source , int depth , String baseURL ) { log . debug ( "Parsing an HTML message..." ) ; boolean resourcesfound = false ; List < Element > elements = source . getAllElements ( HTMLElementName . A ) ; for ( Element el : elements ) { resourcesfound |= processAttributeElement ( message , depth , baseURL , el , "href" ) ; } elements = source . getAllElements ( HTMLElementName . AREA ) ; for ( Element el : elements ) { resourcesfound |= processAttributeElement ( message , depth , baseURL , el , "href" ) ; } elements = source . getAllElements ( HTMLElementName . FRAME ) ; for ( Element el : elements ) { resourcesfound |= processAttributeElement ( message , depth , baseURL , el , "src" ) ; } elements = source . getAllElements ( HTMLElementName . IFRAME ) ; for ( Element el : elements ) { resourcesfound |= processAttributeElement ( message , depth , baseURL , el , "src" ) ; } elements = source . getAllElements ( HTMLElementName . LINK ) ; for ( Element el : elements ) { resourcesfound |= processAttributeElement ( message , depth , baseURL , el , "href" ) ; } elements = source . getAllElements ( HTMLElementName . SCRIPT ) ; for ( Element el : elements ) { resourcesfound |= processAttributeElement ( message , depth , baseURL , el , "src" ) ; } elements = source . getAllElements ( HTMLElementName . IMG ) ; for ( Element el : elements ) { resourcesfound |= processAttributeElement ( message , depth , baseURL , el , "src" ) ; } elements = source . getAllElements ( HTMLElementName . META ) ; for ( Element el : elements ) { String equiv = el . getAttributeValue ( "http-equiv" ) ; String content = el . getAttributeValue ( "content" ) ; if ( equiv != null && content != null ) { if ( equiv . equalsIgnoreCase ( "refresh" ) || equiv . equalsIgnoreCase ( "location" ) ) { Matcher matcher = urlPattern . matcher ( content ) ; if ( matcher . find ( ) ) { String url = matcher . group ( 1 ) ; processURL ( message , depth , url , baseURL ) ; resourcesfound = true ; } } } } return resourcesfound ; }
parses the html jericho source for the elements that contain references to other resources .
