def _cleanup(self, elements): for element in elements: remove_childrens(element, 'td[@align="right" and width="100%" and @class="buttonheading"]') remove_childrens(element, 'iframe', 'form', 'script', 'noscript') pop_chilren_attrs(element, 'onclick', 'style', 'align', 'valign') for a_elem in element.xpath('.//img/../../a'): a_elem.drop_tag()
def _cleanup(self, elements): for element in elements: pop_chilren_attrs(element, 'style')