Home | Trees | Indices | Help |
---|
|
PageElement --+ | Tag --+ | markupbase.ParserBase --+ | | | sgmllib.SGMLParser --+ | BeautifulStoneSoup --+ | BeautifulSOAP
This class will push a tag with only a single string child into the tag's parent as an attribute. The attribute's name is the tag name, and the value is the string child. An example should give the flavor of the change: <foo><bar>baz</bar></foo> => <foo bar="baz"><bar>baz</bar></foo> You can then access fooTag['bar'] instead of fooTag.barTag.string. This is, of course, useful for scraping structures that tend to use subelements instead of attributes, such as SOAP messages. Note that it modifies its input, so don't print the modified version out. I'm not sure how many people really want to use this class; let me know if you do. Mainly I like the name.
|
|||
|
|||
Inherited from Inherited from Inherited from Inherited from Inherited from Inherited from Inherited from Inherited from Inherited from Inherited from |
|
|||
Inherited from Inherited from Inherited from Inherited from |
|
|
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0beta1 on Thu Nov 8 17:49:29 2007 | http://epydoc.sourceforge.net |