#NEWLINE# def clean_bad_tags( self , doc ) : #NEWLINE# #INDENT# naughty_list = self . parser . xpath_re ( doc , self . nauthy_ids_re ) #NEWLINE# for node in naughty_list : #NEWLINE# #INDENT# self . parser . remove ( node ) #NEWLINE# #UNINDENT# naughty_classes = self . parser . xpath_re ( node , self . nauthy_classes_re ) #NEWLINE# for node in naughty_classes : #NEWLINE# #INDENT# self . parser . remove ( node ) #NEWLINE# #UNINDENT# naughty_names = self . parser . xpath_re ( doc , self . nauthy_names_re ) #NEWLINE# for node in naughty_names : #NEWLINE# #INDENT# self . parser . remove ( node ) #NEWLINE# #UNINDENT# return doc