class documentation

This TreeBuilder knows facts about HTML. Such as which tags are empty-element tags.

Method set_up_substitutions Replace the declared encoding in a <meta> tag with a placeholder, to be substituted when the tag is output to a string.
Constant DEFAULT_CDATA_LIST_ATTRIBUTES Undocumented
Constant DEFAULT_PRESERVE_WHITESPACE_TAGS Undocumented
Constant DEFAULT_STRING_CONTAINERS Undocumented
Class Variable block_elements Undocumented
Class Variable empty_element_tags Undocumented

Inherited from TreeBuilder:

Method __init__ Constructor.
Method can_be_empty_element Might a tag with this name be an empty-element tag?
Method feed Run some incoming markup through some parsing process, populating the `BeautifulSoup` object in self.soup.
Method initialize_soup The BeautifulSoup object has been initialized and is now being associated with the TreeBuilder.
Method prepare_markup Run any preliminary steps necessary to make incoming markup acceptable to the parser.
Method reset Do any work necessary to reset the underlying parser for a new document.
Method test_fragment_to_document Wrap an HTML fragment to make it look like a document.
Constant ALTERNATE_NAMES Undocumented
Constant NAME Undocumented
Constant TRACKS_LINE_NUMBERS Undocumented
Constant USE_DEFAULT Undocumented
Class Variable features Undocumented
Class Variable is_xml Undocumented
Class Variable picklable Undocumented
Instance Variable cdata_list_attributes Undocumented
Instance Variable preserve_whitespace_tags Undocumented
Instance Variable soup Undocumented
Instance Variable store_line_numbers Undocumented
Instance Variable string_containers Undocumented
Method _replace_cdata_list_attribute_values When an attribute value is associated with a tag that can have multiple values for that attribute, convert the string value to a list of strings.
def set_up_substitutions(self, tag): (source)

Replace the declared encoding in a <meta> tag with a placeholder, to be substituted when the tag is output to a string. An HTML document may come in to Beautiful Soup as one encoding, but exit in a different encoding, and the <meta> tag needs to be changed to reflect this. :param tag: A `Tag` :return: Whether or not a substitution was performed.

DEFAULT_CDATA_LIST_ATTRIBUTES: dict = (source)

Undocumented

Value
{'*': ['class', 'accesskey', 'dropzone'],
 'a': ['rel', 'rev'],
 'link': ['rel', 'rev'],
 'td': ['headers'],
 'th': ['headers'],
 'td': ['headers'],
 'form': ['accept-charset'],
...
DEFAULT_PRESERVE_WHITESPACE_TAGS = (source)

Undocumented

Value
set(['pre', 'textarea'])
DEFAULT_STRING_CONTAINERS = (source)

Undocumented

Value
{'rt': RubyTextString,
 'rp': RubyParenthesisString,
 'style': Stylesheet,
 'script': Script,
 'template': TemplateString}
block_elements = (source)

Undocumented

empty_element_tags = (source)