The elements.html classes¶
The purpose of this module is to provide classes corresponding to most elements (except <style>, <script> and similar non-document content elements) and core attributes (except @style and the %events attributes) of HTML4.01 and HTML5. It is not totally compliant with the HTML4.01 and HTML5 standards, but is enough to model most real-world HTML. It contains no provisions to ensure that elements of a particular kind only contain allowed sub-elements.
- ferenda.elements.html.elements_from_soup(soup, remove_tags=(u'script', u'style', u'font', u'map', u'center'), keep_attributes=(u'class', u'id', u'dir', u'lang', u'src', u'href', u'name', u'alt'))[source]¶
Converts a BeautifulSoup tree into a tree of ferenda.elements.html.HTMLElement objects. Some non-semantic attributes and tags are removed in the process.
Parameters: Returns: tree of element objects
Return type: ferenda.elements.html.HTMLElement
- class ferenda.elements.html.HTMLElement(*args, **kwargs)[source]¶
Abstract base class for all elements.
- class ferenda.elements.html.Title(*args, **kwargs)[source]¶
Element corresponding to the <title> tag
- class ferenda.elements.html.Blockquote(*args, **kwargs)[source]¶
Element corresponding to the <blockquote> tag
- class ferenda.elements.html.Table(*args, **kwargs)[source]¶
Element corresponding to the <table> tag
- class ferenda.elements.html.Fieldset(*args, **kwargs)[source]¶
Element corresponding to the <fieldset> tag
- class ferenda.elements.html.Address(*args, **kwargs)[source]¶
Element corresponding to the <address> tag
- class ferenda.elements.html.Small(*args, **kwargs)[source]¶
Element corresponding to the <small> tag
- class ferenda.elements.html.Strong(*args, **kwargs)[source]¶
Element corresponding to the <strong > tag
- class ferenda.elements.html.Acronym(*args, **kwargs)[source]¶
Element corresponding to the <acronym> tag
- class ferenda.elements.html.Object(*args, **kwargs)[source]¶
Element corresponding to the <object > tag
- class ferenda.elements.html.Input(*args, **kwargs)[source]¶
Element corresponding to the <input> tag
- class ferenda.elements.html.Select(*args, **kwargs)[source]¶
Element corresponding to the <select> tag
- class ferenda.elements.html.Textarea(*args, **kwargs)[source]¶
Element corresponding to the <textarea> tag
- class ferenda.elements.html.Label(*args, **kwargs)[source]¶
Element corresponding to the <label> tag
- class ferenda.elements.html.Button(*args, **kwargs)[source]¶
Element corresponding to the <button> tag
- class ferenda.elements.html.Caption(*args, **kwargs)[source]¶
Element corresponding to the <caption> tag
- class ferenda.elements.html.Thead(*args, **kwargs)[source]¶
Element corresponding to the <thead> tag
- class ferenda.elements.html.Tfoot(*args, **kwargs)[source]¶
Element corresponding to the <tfoot> tag
- class ferenda.elements.html.Tbody(*args, **kwargs)[source]¶
Element corresponding to the <tbody> tag
- class ferenda.elements.html.Colgroup(*args, **kwargs)[source]¶
Element corresponding to the <colgroup> tag
- class ferenda.elements.html.Article(*args, **kwargs)[source]¶
Element corresponding to the <article> tag
- class ferenda.elements.html.Aside(*args, **kwargs)[source]¶
Element corresponding to the <aside> tag
- class ferenda.elements.html.Details(*args, **kwargs)[source]¶
Element corresponding to the <details> tag
- class ferenda.elements.html.Dialog(*args, **kwargs)[source]¶
Element corresponding to the <dialog> tag
- class ferenda.elements.html.Summary(*args, **kwargs)[source]¶
Element corresponding to the <summary> tag
- class ferenda.elements.html.Figure(*args, **kwargs)[source]¶
Element corresponding to the <figure> tag
Element corresponding to the <figcaption> tag
Element corresponding to the <footer> tag
- class ferenda.elements.html.Header(*args, **kwargs)[source]¶
Element corresponding to the <header> tag
- class ferenda.elements.html.Hgroup(*args, **kwargs)[source]¶
Element corresponding to the <hgroup> tag
- class ferenda.elements.html.Meter(*args, **kwargs)[source]¶
Element corresponding to the <meter> tag
Element corresponding to the <nav> tag
- class ferenda.elements.html.Progress(*args, **kwargs)[source]¶
Element corresponding to the <progress> tag