Logo Search packages:      
Sourcecode: calibre version File versions

calibre::ebooks::BeautifulSoup::BeautifulSOAP Class Reference

Inheritance diagram for calibre::ebooks::BeautifulSoup::BeautifulSOAP:

calibre::ebooks::BeautifulSoup::BeautifulStoneSoup calibre::ebooks::BeautifulSoup::Tag calibre::ebooks::BeautifulSoup::PageElement

List of all members.

Detailed Description

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>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

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 1583 of file BeautifulSoup.py.

Public Member Functions

def __getattr__
def __init__
def __init__
def append
def close
def convert_charref
def convert_codepoint
def convert_entityref
def endData
def error
def extract
def feed
def findAllNext
def findAllPrevious
def findNext
def findNextSibling
def findNextSiblings
def findParent
def findParents
def findPrevious
def findPreviousSibling
def findPreviousSiblings
def finish_endtag
def finish_shorttag
def finish_starttag
def get_starttag_text
def goahead
def handle_charref
def handle_comment
def handle_data
def handle_decl
def handle_endtag
def handle_entityref
def handle_pi
def handle_starttag
def insert
def isSelfClosingTag
def nextGenerator
def nextSiblingGenerator
def parentGenerator
def parse_declaration
def parse_endtag
def parse_pi
def parse_starttag
def popTag
def previousGenerator
def previousSiblingGenerator
def pushTag
def replaceWith
def report_unbalanced
def reset
def setliteral
def setnomoretags
def setup
def substituteEncoding
def toEncoding
def unknown_charref
def unknown_endtag
def unknown_entityref
def unknown_starttag
def unknown_starttag

Public Attributes


Static Public Attributes

tuple entity_or_charref
 entitydefs = \
 fetchNextSiblings = findNextSiblings
 fetchParents = findParents
 fetchPrevious = findAllPrevious
 fetchPreviousSiblings = findPreviousSiblings
string HTML_ENTITIES = "html"
dictionary NESTABLE_TAGS = {}
dictionary QUOTE_TAGS = {}
dictionary RESET_NESTING_TAGS = {}
string ROOT_TAG_NAME = u'[document]'
dictionary SELF_CLOSING_TAGS = {}
dictionary STRIP_ASCII_SPACES = { 9: None, 10: None, 12: None, 13: None, 32: None, }
string XHTML_ENTITIES = "xhtml"
string XML_ENTITIES = "xml"

The documentation for this class was generated from the following file:

Generated by  Doxygen 1.6.0   Back to index