

def title(page, response):
    'Extract <title></title>'
    regexp = '<head>.*?<title>(?P<title>.*?)</title>.*?</head>'
    blocks = re.finditer(regexp, page, re.DOTALL)
    for block in blocks:
        response['title'] = block.group('title')
    return response

dataset/ETHPy150Open treeio/treeio/treeio/core/ajax/rules.py title/original