Examples of extractAllNodesThatMatch()


Examples of org.htmlparser.Parser.extractAllNodesThatMatch()

    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;
View Full Code Here

Examples of org.htmlparser.Parser.extractAllNodesThatMatch()

      }

      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

Examples of org.htmlparser.Parser.extractAllNodesThatMatch()

    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

Examples of org.htmlparser.Parser.extractAllNodesThatMatch()

       
                parser = new Parser(output.toString());
               
                log.debug("Extracting all nodes that match the filter.");
       
                list = parser.extractAllNodesThatMatch(filter);
               
                log.debug("About to iterate through the matching nodes, count=" + list.size());
       
                for (int i = 0; i < list.size(); i++)
                {
View Full Code Here

Examples of org.htmlparser.Parser.extractAllNodesThatMatch()

                                           }
                                       });
               
                parser = new Parser(output.toString());
               
                list = parser.extractAllNodesThatMatch(filter);
               
                for (int i = 0; i < list.size(); i++)
                {
                    String linkTag = list.elementAt(i).toHtml();
                   
View Full Code Here

Examples of org.htmlparser.Parser.extractAllNodesThatMatch()

                }
            );
        try
        {
            parser = new Parser (url);
            list = parser.extractAllNodesThatMatch (filter);
            for (int i = 0; i < list.size (); i++)
                System.out.println (list.elementAt (i).toHtml ());
        }
        catch (ParserException e)
        {
View Full Code Here

Examples of org.htmlparser.Parser.extractAllNodesThatMatch()

       
        Parser parser = new Parser();
        NodeFilter filterLink = new TagNameFilter (tag);
        NodeList links = new NodeList ();
        parser = createParserParsingAnInputString(output);
        links = parser.extractAllNodesThatMatch(filterLink);

        // loop to remove tags added recursively
        // so if you have selected 'not recursive option'
        // you have only the tag container and not the contained tags.
        if (!recursive)
View Full Code Here

Examples of org.htmlparser.Parser.extractAllNodesThatMatch()

    {
       
        Parser parser = new Parser();
        NodeList links = new NodeList ();
        parser = createParserParsingAnInputString(output);
        links = parser.extractAllNodesThatMatch(filter);

        // loop to remove tags added recursively
        // so if you have selected 'not recursive option'
        // you have only the tag container and not the contained tags.
        if (!recursive)
View Full Code Here

Examples of org.htmlparser.Parser.extractAllNodesThatMatch()

        l = new Lexer (html);
        p = new Parser (l);
        it = new CssSelectorNodeFilter ("li + li");
        count = 0;
        for (i = p.extractAllNodesThatMatch (it).elements (); i.hasMoreNodes ();)
        {
            assertEquals ("tag name wrong", "LI", ((Tag)i.nextNode()).getTagName());
            count++;
        }
        assertEquals ("wrong count", 2, count);
View Full Code Here

Examples of org.htmlparser.Parser.extractAllNodesThatMatch()

        lexer = new Lexer (html);
        parser = new Parser (lexer);
        filter = new RegexFilter ("(19|20)\\d\\d([- \\\\/.](0[1-9]|1[012])[- \\\\/.](0[1-9]|[12][0-9]|3[01]))?");
        count = 0;
        for (iterator = parser.extractAllNodesThatMatch (filter).elements (); iterator.hasMoreNodes ();)
        {
            assertEquals ("text wrong", target, iterator.nextNode ().toHtml ());
            count++;
        }
        assertEquals ("wrong count", 1, count);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.