def _parse_fields(parsed):
 out = []
 tags = parsed.find_all(_tag_ptn)
 for tag in tags:
  helpers.lowercase_attr_names(tag)
 while tags:
  tag = tags.pop(0)
  try:
   field = _parse_field(tag, tags)
  except exceptions.InvalidNameError:
   continue
  if (field is not None):
   out.append(field)
 return out

def _parse_fields ( parsed ) : out = [ ] tags = parsed . find_all ( _tag_ptn ) for tag in tags : helpers . lowercase_attr_names ( tag ) while tags : tag = tags . pop ( 0 ) try : field = _parse_field ( tag , tags ) except exceptions . InvalidNameError : continue if ( field is not None ) : out . append ( field ) return out
parse form fields from html .