示例#1
0
def replace_tags_with_text(top_node):
    """
    Replace common tags with just text so we don't have any crazy
    formatting issues so replace <br>, <i>, <strong>, etc.... with whatever
    text is inside them code:
    http://lxml.de/api/lxml.etree-module.html#strip_tags.
    """
    parser.strip_tags(top_node, 'b', 'strong', 'i', 'br')
示例#2
0
def convert_links_to_text(top_node):
    """
    Cleans up and converts any nodes that  should be considered text into
    text.
    """
    parser.strip_tags(top_node, 'a')