Logo Search packages:      
Sourcecode: wapiti version File versions  Download package

def BeautifulSoup::PageElement::extract (   self  )  [inherited]

Destructively rips this element out of the tree.

Definition at line 102 of file BeautifulSoup.py.

00102                      :
        """Destructively rips this element out of the tree."""        
        if self.parent:
            try:
                self.parent.contents.remove(self)
            except ValueError:
                pass

        #Find the two elements that would be next to each other if
        #this element (and any children) hadn't been parsed. Connect
        #the two.        
        lastChild = self._lastRecursiveChild()
        nextElement = lastChild.next

        if self.previous:
            self.previous.next = nextElement
        if nextElement:
            nextElement.previous = self.previous
        self.previous = None
        lastChild.next = None

        self.parent = None        
        if self.previousSibling:
            self.previousSibling.nextSibling = self.nextSibling
        if self.nextSibling:
            self.nextSibling.previousSibling = self.previousSibling
        self.previousSibling = self.nextSibling = None       

    def _lastRecursiveChild(self):


Generated by  Doxygen 1.6.0   Back to index