Package org.htmlparser.tags

Examples of org.htmlparser.tags.InputTag


   //*-- string extractor does not input form values -- handle separately
   parser.setInputHTML(htmlcontents); StringBuffer inputVal = new StringBuffer();
   NodeList nodelist3 = parser.parse(new TagNameFilter ("INPUT"));
   for (int i = 0; i < nodelist3.size(); i++)
   { InputTag itag = (InputTag) nodelist3.elementAt(i);
   if ((itag != null) && (itag.getAttribute("value") != null) )
   { inputVal.append(" "); inputVal.append( itag.getAttribute("value") ); }
   }

   //*-- finally set the contents of the document
   doc.setContents( new StringBuffer(cleanHTML( st.extractStrings(false)) + " " + inputVal) );
   doc.setFileName(ifile);
View Full Code Here


                    AppletTag applet= (AppletTag)node;
                    binUrlStr= applet.getAppletClass();
                }
                else if (node instanceof InputTag)
                {
                    InputTag input= (InputTag)node;
                    // we check the input tag type for image
                    String strType= input.getAttribute("type");
                    if (strType != null && strType.equalsIgnoreCase("image"))
                    {
                        // then we need to download the binary
                        binUrlStr= input.getAttribute("src");
                    }
        } else if (node instanceof LinkTag){
          LinkTag link = (LinkTag)node;
          if (link.getChild(0) instanceof ImageTag){
            ImageTag img = (ImageTag)link.getChild(0);
View Full Code Here

    public void testToHTML() throws ParserException
    {
        parseAndAssertNodeCount(1);
        assertTrue("Node 1 should be INPUT Tag", node[0] instanceof InputTag);
        InputTag InputTag;
        InputTag = (InputTag) node[0];
        assertEquals(
            "HTML String",
            "<INPUT NAME=\"Google\" TYPE=\"text\">",
            InputTag.toHtml());
    }
View Full Code Here

    public void testToString() throws ParserException
    {
        parseAndAssertNodeCount(1);
        assertTrue("Node 1 should be INPUT Tag", node[0] instanceof InputTag);
        InputTag InputTag;
        InputTag = (InputTag) node[0];
        assertEquals(
            "HTML Raw String",
            "INPUT TAG\n--------\nNAME : Google\nTYPE : text\n",
            InputTag.toString());
    }
View Full Code Here

        createParser(testHTML);
        parser.addScanner(new InputTagScanner("-i"));

        parseAndAssertNodeCount(1);
        assertTrue("Node 1 should be INPUT Tag", node[0] instanceof InputTag);
        InputTag InputTag;
        InputTag = (InputTag) node[0];
        assertStringEquals(
            "HTML String",
            "<INPUT CHECKED=\"\" NAME=\"cbCheck\" TYPE=\"checkbox\">",
            InputTag.toHtml());
    }
View Full Code Here

    protected void assertHiddenIDTagPresent(
        FormTag formTag,
        String name,
        String inputTagValue)
    {
        InputTag inputTag = formTag.getInputTag(name);
        assertNotNull(
            "Hidden Tag " + name + " should have been there",
            inputTag);
        assertStringEquals(
            "Hidden Tag Contents",
            inputTagValue,
            inputTag.getAttribute("VALUE"));
        assertStringEquals(
            "Hidden Tag Type",
            "hidden",
            inputTag.getAttribute("TYPE"));
    }
View Full Code Here

        parser.addScanner(scanner);
        parseAndAssertNodeCount(1);
        assertTrue(node[0] instanceof InputTag);

        // check the input node
        InputTag inputTag = (InputTag) node[0];
        assertEquals("Input Scanner", scanner, inputTag.getThisScanner());
        assertEquals("Type", "text", inputTag.getAttribute("TYPE"));
        assertEquals("Name", "Google", inputTag.getAttribute("NAME"));
    }
View Full Code Here

        assertStringEquals(
            "Location",
            "http://www.google.com/test/do_login.php",
            formTag.getFormLocation());
        assertStringEquals("Name", "login_form", formTag.getFormName());
        InputTag nameTag = formTag.getInputTag("name");
        InputTag passwdTag = formTag.getInputTag("passwd");
        InputTag submitTag = formTag.getInputTag("submit");
        InputTag dummyTag = formTag.getInputTag("dummy");
        assertNotNull("Input Name Tag should not be null", nameTag);
        assertNotNull("Input Password Tag should not be null", passwdTag);
        assertNotNull("Input Submit Tag should not be null", submitTag);
        assertNull("Input dummy tag should be null", dummyTag);
View Full Code Here

    }

    protected Tag createTag(TagData tagData, Tag tag, String url)
        throws ParserException
    {
        return new InputTag(tagData);
    }
View Full Code Here

                    AppletTag applet= (AppletTag)node;
                    binUrlStr= applet.getAppletClass();
                }
                else if (node instanceof InputTag)
                {
                    InputTag input= (InputTag)node;
                    // we check the input tag type for image
                    String strType= input.getAttribute("type");
                    if (strType != null && strType.equalsIgnoreCase("image"))
                    {
                        // then we need to download the binary
                        binUrlStr= input.getAttribute("src");
                    }
        } else if (node instanceof LinkTag){
          LinkTag link = (LinkTag)node;
          if (link.getChild(0) instanceof ImageTag){
            ImageTag img = (ImageTag)link.getChild(0);
View Full Code Here

TOP

Related Classes of org.htmlparser.tags.InputTag

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.