Package diffpy :: Package srrietveld :: Module bugreport :: Class _HTMLFormDataGetter
[hide private]
[frames] | no frames]

Class _HTMLFormDataGetter

source code

markupbase.ParserBase --+    
                        |    
    HTMLParser.HTMLParser --+
                            |
                           _HTMLFormDataGetter

Helper HTMLParser for extracting form data attributes from the first form.

Instance data:

_formattrs -- list of attribute dictionaries for all <form> tags _formdata -- list of input data dictionaries from all <form> tags

See also getFormData().

Instance Methods [hide private]
 
handle_starttag(self, tag, attrs)
Store data dictionary for all HTML forms in the document.
source code
 
__call__(self, content)
Return a list of data dictionaries for all HTML forms in the document.
source code

Inherited from HTMLParser.HTMLParser: __init__, check_for_whole_start_tag, clear_cdata_mode, close, error, feed, get_starttag_text, goahead, handle_charref, handle_comment, handle_data, handle_decl, handle_endtag, handle_entityref, handle_pi, handle_startendtag, parse_endtag, parse_pi, parse_starttag, reset, set_cdata_mode, unescape, unknown_decl

Inherited from markupbase.ParserBase: getpos, parse_comment, parse_declaration, parse_marked_section, updatepos

Inherited from markupbase.ParserBase (private): _parse_doctype_attlist, _parse_doctype_element, _parse_doctype_entity, _parse_doctype_notation, _parse_doctype_subset, _scan_name

Class Variables [hide private]
  _formattrs = None
  _formdata = None

Inherited from HTMLParser.HTMLParser: CDATA_CONTENT_ELEMENTS, entitydefs

Inherited from markupbase.ParserBase (private): _decl_otherchars

Method Details [hide private]

handle_starttag(self, tag, attrs)

source code 

Store data dictionary for all HTML forms in the document.

Overrides: HTMLParser.HTMLParser.handle_starttag

__call__(self, content)
(Call operator)

source code 

Return a list of data dictionaries for all HTML forms in the document.

content -- HTML code

Return two lists of dictionaries for form attributes and form data. Raise ValueError for invalid HTML code or when no form is present.