Class HTMLForm

java.lang.Object
org.archive.modules.forms.HTMLForm

public class HTMLForm extends Object
Simple representation of a discovered HTML Form.
Author:
gojomo
  • Field Details

  • Constructor Details

    • HTMLForm

      public HTMLForm()
  • Method Details

    • addField

      public void addField(String type, String name, String value, boolean checked)
      Add a discovered INPUT, tracking it as potential username/password receiver.
      Parameters:
      type -
      name -
      value -
      checked - true if "checked" attribute is present (for radio buttons and checkboxes)
    • isMultipleFormSubmitInputs

      public boolean isMultipleFormSubmitInputs(String type)
    • addField

      public void addField(String type, String name, String value)
      Add a discovered INPUT, tracking it as potential username/password receiver.
      Parameters:
      type -
      name -
      value -
    • setMethod

      public void setMethod(String method)
    • getAction

      public String getAction()
    • setAction

      public void setAction(String action)
    • getEnctype

      public String getEnctype()
    • setEnctype

      public void setEnctype(String enctype)
    • seemsLoginForm

      public boolean seemsLoginForm()
      For now, we consider a POST form with only 1 password field and 1 potential username field (type text or email) to be a likely login form.
      Returns:
      boolean likely login form
    • presumedUsernameInput

      protected HTMLForm.FormInput presumedUsernameInput()
    • formData

      public LinkedList<HTMLForm.NameValue> formData(String username, String password)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • asAnnotation

      public String asAnnotation()
      Provide abbreviated annotation, of the form... "form:Phhpt" ...where the first capital letter indicates submission type, G[ET] or P[OST], and following lowercase letters types of inputs in order, by their first letter.
      Returns:
      String suitable for brief crawl.log annotation