Package openid :: Package consumer :: Module html_parse
[frames] | no frames]

Module html_parse

source code

This module implements a VERY limited parser that finds <link> tags in the head of HTML or XHTML documents and parses out their attributes according to the OpenID spec. It is a liberal parser, but it requires these things from the data in order to work:

From http://openid.net/specs.bml#linkrel:

The parser ignores SGML comments and <![CDATA[blocks]]>. Both kinds of quoting are allowed for attributes.

The parser deals with invalid markup in these ways:

Functions
[[(type(html), type(html))]]
parseLinkAttrs(html)
Find all link tags in a string representing a HTML document and return a list of their attributes.
source code
Function Details

parseLinkAttrs(html)

source code 

Find all link tags in a string representing a HTML document and return a list of their attributes.

Parameters:
  • html (str or unicode) - the text to parse
Returns: [[(type(html), type(html))]]
A list of dictionaries of attributes, one for each link tag