Public Member Functions | |
def | popTag |
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.
Definition at line 1430 of file BeautifulSoup.py.
def BeautifulSoup.BeautifulSOAP.popTag | ( | self | ) |
Reimplemented from BeautifulSoup.BeautifulStoneSoup.
Definition at line 1450 of file BeautifulSoup.py.