def is_text(self):
''' Check if this element is a text
Also comments and processing instructions
are instances of NavigableString,
so we have to make additional checks
'''
if not isinstance(self.context, NavigableString):
return False
if (
self.is_comment() or
self.is_doctype() or
self.is_processing_instruction()
):
return False
return True
评论列表
文章目录