Package org.htmlparser.filters

Examples of org.htmlparser.filters.NodeClassFilter


    try {
      tmpRecherche = "http://www.imdb.com/find?s=tt&q=" + localParent.getJValeurNom().getText().replaceAll(" ", "+");

      parser = new Parser(tmpRecherche);

      listTitleNode = parser.extractAllNodesThatMatch(new NodeClassFilter (TitleTag.class));
      //On commence par d�tecter le titre
      for(i = 0;i < listTitleNode.size(); i++){
        tmpString = listTitleNode.elementAt(i).toHtml();
        if(tmpString.indexOf("IMDb Title  Search") <= -1){
          urlFilm = tmpRecherche;
        }
      }

      if(urlFilm == null){
        parser.reset();
        parser.setResource(tmpRecherche);       
        listUrlNode = parser.extractAllNodesThatMatch (new NodeClassFilter (LinkTag.class));
        //On d�tecte d'abord les liens
        for (i = 0; i < listUrlNode.size(); i++){
          tmpString = listUrlNode.elementAt(i).toHtml();
          tmpLien = tmpString.substring(tmpString.indexOf("<a href=")+9, tmpString.indexOf(">")-1);
          if(tmpLien.startsWith("/title/")){
View Full Code Here


    int indexFin = 0;


    try{
      divParser = new Parser(urlFilm);
      listDiv = divParser.extractAllNodesThatMatch (new NodeClassFilter (Div.class));
      for (int i = 0; i < listDiv.size(); i++){
        NodeList tmpDivNodeContent = listDiv.elementAt(i).getChildren();

        if(tmpDivNodeContent != null){
          for(int j = 0; j< tmpDivNodeContent.size(); j++){
View Full Code Here

      try {
        parser.setURL(BROWSE_CATEGORIES_URL);
 
        NodeFilter categoryFilter = new AndFilter(
            new HasAncestorFilter(new HasAttributeFilter("id", "genres")),
            new NodeClassFilter(LinkTag.class)
        );
 
        NodeList categoryNodes = parser.extractAllNodesThatMatch(categoryFilter);
 
        if (categoryNodes.size() > 0) {
View Full Code Here

  }
 
  private void parseShippedList(Node queue, List<MovieItem> items) {
    NodeFilter discFilter = new CssClassFilter("or");
    NodeCollector infoCollector = new NodeCollector(new NodeFilter[] {
        new AndFilter(new NodeClassFilter(LinkTag.class),
            new HasParentFilter(new CssClassFilter("qt"))),
        new AndFilter(new NodeClassFilter(ImageTag.class),
            new CssClassFilter("star")),
        new CssClassFilter("ec"),
        new CssClassFilter("e"),
        new CssClassFilter("ee")
        });
View Full Code Here

  }
 
  private void parseMovieQueue(Node queue, List<MovieItem> items) {
    NodeFilter discFilter = new CssClassFilter("bd");
    NodeCollector infoCollector = new NodeCollector(new NodeFilter[] {
        new AndFilter(new NodeClassFilter(LinkTag.class),
            new HasParentFilter(new CssClassFilter("stc"))),
           
        new AndFilter(new NodeClassFilter(ImageTag.class),
            new CssClassFilter("star")),
           
        new CssClassFilter("ec"),
        new CssClassFilter("e")
        });
View Full Code Here

          }
     
      parser.setURL(BROWSE_CATEGORY_URL + category.getId() + "&pageNum=" + page);
 
      NodeFilter discFilter = new AndFilter(
          new NodeClassFilter(TableRow.class),
          new HasChildFilter(new HasChildFilter(new CssClassFilter("list-title")))
      );
     
 
      NodeCollector infoCollector = new NodeCollector(new NodeFilter[] {
          new AndFilter(new NodeClassFilter(LinkTag.class),
              new HasParentFilter(new CssClassFilter("list-title"))),
          new CssClassFilter("list-titleyear"),
          new CssClassFilter("list-mpaa"),
          new AndFilter(new NodeClassFilter(ImageTag.class),
              new CssClassFilter("star"))
          });
 
      NodeList discs = parser.extractAllNodesThatMatch(discFilter);
 
View Full Code Here

     
          String url = MessageFormat.format(SEARCH_URL, URLEncoder.encode(query, "UTF-8"), start);
      parser.setURL(url);

      NodeFilter discFilter = new AndFilter(
          new NodeClassFilter(TableRow.class),
          new HasChildFilter(new HasChildFilter(new CssClassFilter("searchDisplay")))
      );
     
      NodeCollector searchCollector = new NodeCollector(new NodeFilter[] {
          new CssClassFilter("activeTab"),
          discFilter,
      });
     
 
      NodeCollector infoCollector = new NodeCollector(new NodeFilter[] {
          new AndFilter(new NodeClassFilter(LinkTag.class),
              new HasParentFilter(new CssClassFilter("searchDisplay"))),
          new AndFilter(new NodeClassFilter(Span.class),
              new HasParentFilter(new CssClassFilter("searchDisplay"))),
          new AndFilter(new NodeClassFilter(ImageTag.class),
              new CssClassFilter("star"))
          });
 
      parser.extractAllNodesThatMatch(searchCollector);
      Node activeTab = searchCollector.getNode(0);
View Full Code Here

     
            String url = MessageFormat.format(SEARCH_POPULAR_URL, URLEncoder.encode(query, "UTF-8"), start);
      parser.setURL(url);

      NodeFilter discFilter = new AndFilter(
          new NodeClassFilter(TableRow.class),
          new HasChildFilter(new HasChildFilter(new CssClassFilter("searchDisplay")))
      );

      NodeCollector infoCollector = new NodeCollector(new NodeFilter[] {
          new AndFilter(new NodeClassFilter(LinkTag.class),
              new HasParentFilter(new HasParentFilter(new CssClassFilter("searchDisplay")))),
          new AndFilter(new NodeClassFilter(TextNode.class),
              new HasParentFilter(new CssClassFilter("searchSmallText"))),
          new AndFilter(new NodeClassFilter(ImageTag.class),
              new CssClassFilter("star"))
          });

      NodeList discs = parser.extractAllNodesThatMatch(discFilter);
View Full Code Here

        new HasChildFilter(new HasChildFilter(
            new HasAttributeFilter("href", "/catalog/movieDetails/" + item.getMovieId())))
      );
     
      NodeFilter removeFilter = new AndFilter(
          new NodeClassFilter(LinkTag.class),
          new CssClassFilter("bvr-qremove")
      );

      NodeList discNodes = parser.extractAllNodesThatMatch(discFilter);
View Full Code Here

           
            NodeCollector infoCollector = new NodeCollector(new NodeFilter[] {
                    new CssClassFilter("boxart"),
                    new AndFilter(
                            new HasAncestorFilter(new CssClassFilter("detailDescription")),
                            new NodeClassFilter(TextNode.class)),
                    new AndFilter(
                            new HasAncestorFilter(new CssClassFilter("detailSpecs")),
                            new CssClassFilter("movieInfo"))
            });
            NodeList all = parser.extractAllNodesThatMatch(infoCollector);
View Full Code Here

TOP

Related Classes of org.htmlparser.filters.NodeClassFilter

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.