Package org.htmlparser.tags

Examples of org.htmlparser.tags.InputTag


    assertTrue("Node 0 should be Form Tag", node[0] instanceof FormTag);
    FormTag formTag = (FormTag) node[0];
    assertStringEquals("Method", FormTag.POST, formTag.getFormMethod());
    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


    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

          binUrlStr = image.getImageURL();
        } else if (node instanceof AppletTag) {
          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

                  FormTag form = (FormTag) ni.nextNode();
                  String fragment = "action:"+form.getAttribute("action")+" method:"+form.getAttribute("method");
                  _model.addFragment(url, id, FragmentsModel.KEY_FORMS,fragment );
                }
                for (NodeIterator ni = inputs.elements(); ni.hasMoreNodes(); ) {
                  InputTag tag = (InputTag) ni.nextNode();
                  String type = tag.getAttribute("type");
                  if( "hidden".equals(type))
                  {
                    String fragment = tag.toHtml();
                    _model.addFragment(url, id, FragmentsModel.KEY_HIDDENFIELD, fragment);
                  }
                  if("file".equals(type))
                  {
                    String fragment = tag.toHtml();
                    _model.addFragment(url, id, FragmentsModel.KEY_FILEUPLOAD, fragment);
                  }
                }
            } catch (ParserException pe) {
                _logger.warning("Looking for fragments, got '" + pe + "'");
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.