class_docstr: Authenticate by opening a session via POSTing to HTML form
      
class_docstr_tok: ["Authenticate","by","opening","a","session","via","POSTing","to","HTML","form"]
docstr: Example specification in the .ini config file
  [provider:crcns]
  ...
  credential = crcns ; is not given to authenticator as is
  authentication_type = html_form
  # TODO: may be rename into post_url
  html_form_url = https://crcns.org/login_form
  # probably not needed actually since form_url
  # html_form_tagid = login_form
  html_form_fields = __ac_name={user}
             __ac_password={password}
             submit=Log in
             form.submitted=1
             js_enabled=0
             cookies_enabled=
  html_form_failure_re = (Login failed|Please log in)
  html_form_success_re = You are now logged in
  
  Parameters
  ----------
  fields : str or dict
    String or a dictionary, which will be used (along with credential) information
    to feed into the form
  tagid : str, optional
    id of the HTML <form> in the document to use. If None, and page contains a single form,
    that one will be used.  If multiple forms -- error will be raise
  **kwargs : dict, optional
    Passed to super class HTTPBaseAuthenticator
code: def __init__(self, fields, tagid=None, **kwargs):
      """
  
      Example specification in the .ini config file
      [provider:crcns]
      ...
      credential = crcns ; is not given to authenticator as is
      authentication_type = html_form
      # TODO: may be rename into post_url
      html_form_url = https://crcns.org/login_form
      # probably not needed actually since form_url
      # html_form_tagid = login_form
      html_form_fields = __ac_name={user}
                 __ac_password={password}
                 submit=Log in
                 form.submitted=1
                 js_enabled=0
                 cookies_enabled=
      html_form_failure_re = (Login failed|Please log in)
      html_form_success_re = You are now logged in
  
      Parameters
      ----------
      fields : str or dict
        String or a dictionary, which will be used (along with credential) information
        to feed into the form
      tagid : str, optional
        id of the HTML <form> in the document to use. If None, and page contains a single form,
        that one will be used.  If multiple forms -- error will be raise
      **kwargs : dict, optional
        Passed to super class HTTPBaseAuthenticator
      """
      super(HTMLFormAuthenticator, self).__init__(**kwargs)
      self.fields = ensure_dict_from_str(fields)
      self.tagid = tagid
  
imports: import re
  import requests
  import requests.auth
  from requests.utils import parse_dict_header
  import io
  from time import sleep
  from ..None import __version__
  from ..utils import ensure_list_from_str, ensure_dict_from_str, ensure_bytes
  from ..dochelpers import borrowkwargs
  from ..ui import ui
  from ..utils import auto_repr
  from ..support.network import get_url_filename
  from ..support.network import get_response_disposition_filename
  from ..support.network import rfc2822_to_epoch
  from ..support.cookies import cookies_db
  from ..support.status import FileStatus
  from ..support.exceptions import AccessDeniedError, AccessFailedError, CapturedException, DownloadError, UnhandledRedirectError
  from .base import Authenticator
  from .base import BaseDownloader, DownloaderSession
  from logging import getLogger
  from ..log import LoggerHelper
label_desc: Use image node_id 1 to create a new HTMLFormAuthenticator object from inherited base classes: HTTPBaseAuthenticator with example: obj = HTMLFormAuthenticator(fields, tagid)