def meaning_overview(self): try: section = self._find_section('Bedeutungsübersicht') except AttributeError: return None if section is None: return None node = copy.copy(section) # remove the meaning overview header if node.header: node.header.extract() # remove examples if node.section and node.section.h3.text == 'Beispiele': node.section.extract() # remove figures while node.figure: node.figure.extract() return recursively_extract(node, maxdepth=2, exfun=lambda x: x.text.strip())
def synonyms(self): try: section = self._find_section('Synonyme zu', approximate=True) section = copy.copy(section) if section.header: section.header.extract() return recursively_extract(section, maxdepth=2, exfun=lambda x: x.text.strip()) except AttributeError: return None