import re

import requests
from bs4 import BeautifulSoup


def getTag(html_list):
    """
    输入一个html_list（可能有多个HTML可以并在一起计算效果更好），返回你认为是正文的a标签（或者链接）均可，返回格式不限，到时候我再适配。
    """
    pass


if __name__ == '__main__':
    """
    在这里测试5个网站都是正确的就行，从seed表里取没有正文的
    """
    res = requests.get("https://news.sina.com.cn")
    re_code = "charset=\"(.*?)\""
    match1 = re.search(re_code, res.text)
    res.encoding = "utf-8"
    text = res.text
    bs4 = BeautifulSoup(text, "lxml")
    for item in bs4.select("a"):
        print(item.get('href'))
