Package org.htmlparser.tags

Examples of org.htmlparser.tags.LinkTag.children()


        LinkTag linkTag = (LinkTag) node[0];
        // Get the link data and cross-check
        Node[] dataNode = new Node[10];
        int i = 0;
        for (SimpleNodeIterator e = linkTag.children(); e.hasMoreNodes();)
        {
            dataNode[i++] = (Node) e.nextNode();
        }
        assertEquals("Number of data nodes", new Integer(2), new Integer(i));
        assertTrue(
View Full Code Here


            "http://transfer.go.com/cgi/atransfer.pl?goto=http://www.signs.movies.com&name=114332&srvc=nws&context=283&guid=4AD5723D-C802-4310-A388-0B24E1A79689",
            linkTag.getLink());
        assertEquals("Link Text", "", linkTag.getLinkText());
        Node[] containedNodes = new Node[10];
        int i = 0;
        for (SimpleNodeIterator e = linkTag.children(); e.hasMoreNodes();)
        {
            containedNodes[i++] = e.nextNode();
        }
        assertEquals("There should be 5 contained nodes in the link tag", 5, i);
        assertTrue(
View Full Code Here

        LinkTag linkTag = (LinkTag) node[0];
        // Get the image tag from the link

        Node insideNodes[] = new Node[10];
        int j = 0;
        for (SimpleNodeIterator e = linkTag.children(); e.hasMoreNodes();)
        {
            insideNodes[j++] = (Node) e.nextNode();
        }
        assertEquals("Number of contained internal nodes", 1, j);
        assertTrue(insideNodes[0] instanceof ImageTag);
View Full Code Here

        assertType(
            "Node identified should be HTMLLinkTag",
            LinkTag.class,
            node);
        LinkTag linkTag = (LinkTag) node;
        Node nodeInsideLink = linkTag.children().nextNode();
        assertType(
            "Tag within link should be an image tag",
            ImageTag.class,
            nodeInsideLink);
        ImageTag imageTag = (ImageTag) nodeInsideLink;
View Full Code Here

        TableRow row = (TableRow)node[0];
        TableColumn col = row.getColumns()[1];
        Node node = col.children().nextNode();
        assertType("Node identified should be HTMLLinkTag",LinkTag.class,node);
        LinkTag linkTag = (LinkTag)node;
        Node nodeInsideLink = linkTag.children().nextNode();
        assertType("Tag within link should be an image tag",ImageTag.class,nodeInsideLink);
        ImageTag imageTag = (ImageTag)nodeInsideLink;
        assertStringEquals(
            "Expected Image",
            "http://us.a1.yimg.com/us.yimg.com/a/co/columbiahouse/4for49Freesh_230x33_redx2.gif",
View Full Code Here

        LinkTag linkTag = (LinkTag)node[0];
        // Get the link data and cross-check
        Node [] dataNode= new Node[10];
        int i = 0;
        for (SimpleNodeIterator e = linkTag.children();e.hasMoreNodes();)
        {
            dataNode[i++] = e.nextNode();
        }
        assertEquals("Number of data nodes",new Integer(2),new Integer(i));
        assertTrue("First data node should be an Image Node",dataNode[0] instanceof ImageTag);
View Full Code Here

        LinkTag linkTag = (LinkTag)node[0];
        assertEquals("Link URL","http://transfer.go.com/cgi/atransfer.pl?goto=http://www.signs.movies.com&name=114332&srvc=nws&context=283&guid=4AD5723D-C802-4310-A388-0B24E1A79689",linkTag.getLink());
        assertEquals("Link Text","",linkTag.getLinkText());
        Node [] containedNodes = new Node[10];
        int i=0;
        for (SimpleNodeIterator e = linkTag.children();e.hasMoreNodes();) {
            containedNodes[i++] = e.nextNode();
        }
        assertEquals("There should be 5 contained nodes in the link tag",5,i);
        assertTrue("First contained node should be an image tag",containedNodes[0] instanceof ImageTag);
        ImageTag imageTag = (ImageTag)containedNodes[0];
View Full Code Here

        LinkTag linkTag = (LinkTag) node[0];
        // Get the image tag from the link

        Node insideNodes [] = new Node[10];
        int j =0 ;
        for (SimpleNodeIterator e = linkTag.children();e.hasMoreNodes();) {
            insideNodes[j++]= e.nextNode();
        }
        assertEquals("Number of contained internal nodes",1,j);
        assertTrue(insideNodes[0] instanceof ImageTag);
        ImageTag imageTag = (ImageTag)insideNodes[0];
View Full Code Here

    LinkTag linkTag = (LinkTag) node[0];
    // Get the link data and cross-check
    Node[] dataNode = new Node[10];
    int i = 0;
    for (SimpleNodeIterator e = linkTag.children(); e.hasMoreNodes();) {
      dataNode[i++] = (Node) e.nextNode();
    }
    assertEquals("Number of data nodes", new Integer(2), new Integer(i));
    assertTrue("First data node should be an Image Node", dataNode[0] instanceof ImageTag);
    assertTrue("Second data node shouls be a String Node", dataNode[1] instanceof StringNode);
View Full Code Here

        "http://transfer.go.com/cgi/atransfer.pl?goto=http://www.signs.movies.com&name=114332&srvc=nws&context=283&guid=4AD5723D-C802-4310-A388-0B24E1A79689",
        linkTag.getLink());
    assertEquals("Link Text", "", linkTag.getLinkText());
    Node[] containedNodes = new Node[10];
    int i = 0;
    for (SimpleNodeIterator e = linkTag.children(); e.hasMoreNodes();) {
      containedNodes[i++] = e.nextNode();
    }
    assertEquals("There should be 5 contained nodes in the link tag", 5, i);
    assertTrue("First contained node should be an image tag", containedNodes[0] instanceof ImageTag);
    ImageTag imageTag = (ImageTag) containedNodes[0];
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.