def handle_endtag(self, tag):
        ''' Pop an element from the desired stack and
            extract the data. '''

        o = self.stacks[tag].pop()
        if self.elements.has_key(o):
            self.idd[self.elements[o]] = self.rawdata[o:self.abspos]
 Pop an element from the desired stack and
            extract the data. 
recipes/Python/496787_Extract_elements_id_attributes/recipe-496787.py