Package org.htmlparser.util

Examples of org.htmlparser.util.NodeList.elementAt()


            }
        }
        StringNode[] stringNode = new StringNode[stringNodes.size()];
        for (int i = 0; i < stringNode.length; i++)
        {
            stringNode[i] = (StringNode) stringNodes.elementAt(i);
        }
        return stringNode;
    }

}
View Full Code Here


        parseAndAssertNodeCount(1);

        NodeList nestedBulletLists =
            ((CompositeTag) node[0]).searchFor(BulletList.class);
        assertEquals("bullets in first list", 2, nestedBulletLists.size());
        BulletList firstList = (BulletList) nestedBulletLists.elementAt(0);
        Bullet firstBullet = (Bullet) firstList.childAt(0);
        Node firstNodeInFirstBullet = firstBullet.childAt(0);
        assertType(
            "first child in bullet",
            StringNode.class,
View Full Code Here

        for(int i=0;i<trs.size();i++) {
          NodeList nodes = trs.elementAt(i).getChildren();
          NodeList tds  = nodes.extractAllNodesThatMatch(new TagNameFilter("td"),true);
          for(int j=0;j<tds.size();j++) {
            count++;
            String content = tds.elementAt(j).toHtml();
            Matcher fit =  p.matcher(content);
            if (fit.find()) {
              String[] attributes = fit.group(2).replace("'", "").split(";");
              Map<String,String> mapAtt = new HashMap<String, String>();
              if(attributes.length > 1){
View Full Code Here

            boldStyle.setWrapText(true);
           
            //Loop through excel 'Rows'
            for ( int i = 0; i < rowList.size(); i++ ) {
                HSSFRow row;
                String htmlRow = rowList.elementAt(i).toHtml().trim();
                String[] splitHtmlRow;
                List<String> elements = new ArrayList<String>();
               
                if(i == 0 && headList.size() == 1){
                    row = sheet.createRow((short) i);
View Full Code Here

    parser.reset();
    NodeFilter filter = new CssSelectorNodeFilter("#" + id);
    try {
      NodeList list = parser.extractAllNodesThatMatch(filter);
      if (list.size() > 0) {
        return list.elementAt(0);
      }
    } catch (ParserException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
View Full Code Here

        parser.reset();
        NodeFilter filter = new CssSelectorNodeFilter("#" + id);
        try {
            NodeList list = parser.extractAllNodesThatMatch(filter);
            if (list.size() > 0) {
                return list.elementAt(0);
            }
        } catch (ParserException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
View Full Code Here

            NodeList heads = parser.parse(new TagNameFilter("HEAD"));
            if (heads.size() != 1)
                throw new DiscoveryException(
                        "HTML response must have exactly one HEAD element, " +
                                "found " + heads.size() + " : " + heads.toHtml());
            Node head = heads.elementAt(0);
            for (NodeIterator i = head.getChildren().elements();
                 i.hasMoreNodes();)
            {
                Node node = i.nextNode();
                if (node instanceof TagNode)
View Full Code Here

      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

      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++){
            tmpNode = tmpDivNodeContent.elementAt(j);

            if(tmpNode.toHtml().indexOf("alt=\"Cast\"") > -1 && !acteursVu){
              LinkedList<Acteurs> tmpListActeur = new LinkedList<Acteurs>();
              Acteurs tmpActeur = null;
View Full Code Here

            NodeList heads = parser.parse(new TagNameFilter("HEAD"));
            if (heads.size() != 1)
                throw new DiscoveryException(
                        "HTML response must have exactly one HEAD element, " +
                                "found " + heads.size() + " : " + heads.toHtml());
            Node head = heads.elementAt(0);
            for (NodeIterator i = head.getChildren().elements();
                 i.hasMoreNodes();)
            {
                Node node = i.nextNode();
                if (node instanceof TagNode)
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.