'Returns a list of defined field names from a block of HTML'

@classmethod
def get_field_names_from_html(cls, html):

    names = []
    tree = etree.fromstring(u'<div>{}</div>'.format(html))
    input_fields = ((tree.findall('.//input') + tree.findall('.//select')) + tree.findall('.//textarea'))
    for input_field in input_fields:
        if (('name' in input_field.keys()) and (input_field.attrib['name'] not in names)):
            names.append(input_field.attrib['name'])
    return names
