Package org.vietspider.html.renderer.checker

Examples of org.vietspider.html.renderer.checker.CheckModel


    List<HTMLNode> ignores = new ArrayList<HTMLNode>();
    NodeIterator iterator = node.iterator();
    while(iterator.hasNext()) {
      HTMLNode n = iterator.next();
      if(n.isNode(Name.A)
          && !linkNodeChecker.isValid(new CheckModel(n), 0)) ignores.add(n);
    }
   
    int counter = 0;
    iterator = node.iterator(ignores);
    while(iterator.hasNext()) {
View Full Code Here


//      System.out.println(table.getTextValue());
      }
      return;
    */
   
    CheckModel model = new CheckModel(node);
    int level = 0;
    while(level <= max) {
      for(int i = 0 ; i < checkers.size(); i++) {
        if(!checkers.get(i).isValid(model, level)) {
          //          if(node.getTextValue().indexOf("Năm Mậu Tý đi qua mở") > -1) {
          //            System.out.println("===================================================");
          //            System.out.println(checkers.get(i).getClass());
          //            System.out.println(node.getTextValue());
          //          }
          ignores.add(model.getRemoveNode());
          return;
        }
      }
      level++;
    }
View Full Code Here

 
  private boolean isLinkContent(LinkNodeChecker linkNodeChecker, HTMLNode node, int level) {
    if(node == null || level > 3) return false;
    if(node.isNode(Name.A)) {
      if(linkNodeChecker != null
          && linkNodeChecker.isValid(new CheckModel(node), 0)) return false;
      return true;
    }
    return isLinkContent(linkNodeChecker, node.getParent(), level+1);
  }
View Full Code Here

    filter(node, checkers, maxLevel);
  }

  public void filter(HTMLNode node, List<NodeChecker> checkers, int max) {
    //System.out.println(new String(node.getValue()));
    CheckModel model = new CheckModel(node);

    int level = 0;
    while(level <= max) {
      for(int i = 0 ; i < checkers.size(); i++) {
        if(!checkers.get(i).isValid(model, level)) {
          if(model.getRemoveNode().getTextValue().indexOf("XUÂN YÊU") > -1) {
            System.out.println("===================================================");
            System.out.println(checkers.get(i).getClass());
//            System.out.println(node.getTextValue());
          }
          removeNode(model.getRemoveNode());
          return;
        }
      }
      level++;
    }
View Full Code Here

TOP

Related Classes of org.vietspider.html.renderer.checker.CheckModel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.