INNER CODE UNIT · Python

get_attrs

pingbird/puro · website/pm_attr_list.py:59

def get_attrs(s):
    """ Parse attribute list and return a list of attribute tuples. """
    return _scanner.scan(s)[0]


def isheader(elem):
    return elem.tag in ['h1', 'h2', 'h3', 'h4', 'h5', 'h6']


def _dump_tree(level, elem):
    extra = []
    if elem.text:
        extra.append('text=[%s]' % repr(elem.text))
    if elem.tail:
        extra.append('tail=[%s]' % repr(elem.tail))
    e = ''
    if len(extra) > 0:
        e = '{' + ', '.join(extra) + '}'

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…