<commit_before>#!/usr/bin/env python3
# -*- coding: utf-8 -*-

'第 0008 题：一个HTML文件，找出里面的正文。'

__author__ = 'Drake-Z'

import re

def analysis(a):
    b = re.findall(r'href="(http://.*?.zhihu.com/.*?)"', a)         #以知乎为例
    for i in b:
        print(i)

if __name__ == '__main__':
    with open('testzhihu.html', encoding='utf-8') as html:
        analysis(html.read())<commit_msg>Fix note<commit_after>#!/usr/bin/env python3
# -*- coding: utf-8 -*-

'第 0009 题：一个HTML文件，找出里面的链接。'

__author__ = 'Drake-Z'

import re

def analysis(a):
    b = re.findall(r'href="(http://.*?.zhihu.com/.*?)"', a)         #以知乎为例
    for i in b:
        print(i)

if __name__ == '__main__':
    with open('testzhihu.html', encoding='utf-8') as html:
        analysis(html.read())
{'fraction_non_alphanumeric': 0.20607661822985468, 'fraction_numerical': 0.018494055482166448, 'mean_word_length': 2.86734693877551, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2088343', 'n_tokens_mistral': 336, 'n_tokens_neox': 333, 'n_words': 62}