def get_categories( page ): outlines = page.findall( './/Outline' ) cat_type = {} for out in outlines: tmp = out.find( './/T' ) if tmp.text is not None: tmp_text = strip_span( tmp.text ).strip() cat_type[( tmp_text.replace( ':', '' ) ).lower()] = out return cat_type
def get_title( page ): tmp = page.find( './/T' ) title_text = strip_span( tmp.text ) return title_text.replace( '<a\n', '<a ' )