
"""sorted(title_extracted_by_h,key = lambda x:similarity(x,title_extracted_by_title),reverse=True)

etree.strip_elements(elements,tag) #tag是要删除的标签名
for child in children(element):  #children(element)是一个函数，获取当前HTML元素的所有子元素
    child.tag.lower() #获取标签名称
    etree.strip_tags(child,'span') #删除标签对

element.getparent() #获取给定元素的父元素


"""
# from io import StringIO
#
# import pandas as pd
# data = '"1234","456\r7","897"'
# print(data)
# aa = pd.read_csv(StringIO(data),escapechar='\r')
# print(aa)

# import pandas as pd
#
# # 读取txt文件
# data = pd.read_csv('D:\\美国证券交易委员会\\2022q4\\sub.txt', delimiter='\t')  # 根据实际情况选择正确的分隔符
#
# # 将数据保存为csv文件
# data.to_csv('D:\\美国证券交易委员会\\2022q4\\sub.csv', index=False)  # index=False表示不保存行索引
"""验证码识别测试"""
# import ddddocr
#
# ocr = ddddocr.DdddOcr()
#
# with open("D:\\kkwork\\captchaNew (3).jfif", 'rb') as f:
#     image = f.read()
#
# res = ocr.classification(image)
# print(res)
"""测试中国执行信息公开网  模拟浏览器"""

# import ddddocr
from PIL import Image
import re

import requests, time, random, json, pymysql, redis

import urllib3
from bs4 import BeautifulSoup
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.common.by import By
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from obs import ObsClient
from kafka import KafkaProducer

from base.BaseCore import BaseCore
# baseCore = BaseCore()
# log = baseCore.getLogger()
# cnx_ = baseCore.cnx
# cursor_ = baseCore.cursor
#
# def use_ocr(img):
#     ocr = ddddocr.DdddOcr()
#     with open(img, 'rb') as f:
#         image = f.read()
#     res = ocr.classification(image)
#     print(res)
#     return res
#
# if __name__=="__main__":
#     requests.DEFAULT_RETRIES = 5
#     time_start = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())
#     log.info(f'开始时间为：{time_start}')
#
#     requests.adapters.DEFAULT_RETRIES = 3
#     headers = {
#         'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36',
#     }
#
#     opt = webdriver.ChromeOptions()
#     opt.add_argument(
#         'user-agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36')
#
#     opt.add_argument("--ignore-certificate-errors")
#     opt.add_argument("--ignore-ssl-errors")
#     opt.add_experimental_option("excludeSwitches", ["enable-automation"])
#     opt.add_experimental_option('excludeSwitches', ['enable-logging'])
#     opt.add_experimental_option('useAutomationExtension', False)
#     opt.binary_location = r'D:/Google/Chrome/Application/chrome.exe'
#     chromedriver = r'D:/cmd100/chromedriver.exe'
#     browser = webdriver.Chrome(chrome_options=opt, executable_path=chromedriver)
#     url = "http://zxgk.court.gov.cn/shixin/"
#     browser.get(url)
#     # 可改动
#     time.sleep(20)
#     page_source = browser.page_source
#     soup = BeautifulSoup(page_source, 'html.parser')
#     img_url = soup.select('img[id="captchaImg"]')[0]['src']
#
#     browser.find_element(By.ID, 'pName').send_keys('北京远翰国际教育咨询有限责任公司')
#
#
#     browser.find_element(By.ID, 'yzm').send_keys(yzm)
#     browser.find_element(By.ID, 'searchForm').click()
#     wait = WebDriverWait(browser, 30)
#     wait.until(EC.presence_of_element_located((By.TAG_NAME, "body")))

# screen_img_path = "D:/screen/xxx.png"
# out_img_path = "D:/out/xxx.png"
# ele = driver.find_element(By.ID, 'XXXX')
#
# code = use_ocr(out_img_path)
# 验证码输入框元素.send_keys(code)
# import requests
# headers = {
#     # 'Accept': '*/*',
#     # 'Accept-Encoding': 'gzip, deflate, br',
#     # 'Accept-Language': 'zh-CN,zh-TW;q=0.9,zh;q=0.8',
#     # 'Cache-Control': 'no-cache',
#     # 'Connection': 'keep-alive',
#     # 'Host': 'search-api-web.eastmoney.com',
#     # 'Pragma': 'no-cache',
#     # 'Sec-Fetch-Dest': 'script',
#     # 'Sec-Fetch-Mode': 'no-cors',
#     # 'Sec-Fetch-Site': 'same-site',
#     'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 Edg/120.0.0.0',
#     # 'sec-ch-ua': '"Not_A Brand";v="8", "Chromium";v="120", "Microsoft Edge";v="120"',
#     # 'sec-ch-ua-mobile': '?0',
#     # 'sec-ch-ua-platform': '"Windows"'
# }
# url = "https://www-private-oss.mob.com/academy_reports/2023/03/31/Mob%E7%A0%94%E7%A9%B6%E9%99%A2%E3%80%8A2023%E5%B9%B4%E4%B8%AD%E5%9B%BD%E6%96%87%E6%97%85%E4%BA%A7%E4%B8%9A%E5%8F%91%E5%B1%95%E8%B6%8B%E5%8A%BF%E6%8A%A5%E5%91%8A%E3%80%8B.pdf?response-content-disposition=attachment&OSSAccessKeyId=LTAI5t5mdPuMS9gNj93RPowJ&Expires=1703839064&Signature=X1mpakYGVaBffNokvhvW917UH%2Fk%3D"
#
#
# # res = requests.get(url).text[1:-1]
# res = requests.get(url=url, headers=headers)
# with open('./a.pdf','wb') as f:
#     f.write(res.content)


import datetime
import json

import requests
import pymongo
from base import BaseCore
# baseCore = BaseCore.BaseCore()
# log = baseCore.getLogger()
#
#
# db_storage = pymongo.MongoClient('mongodb://114.115.221.202:27017/', username='admin', password='ZZsn@9988').中科软[
#     '数据源_0504']
#
# datas = db_storage.find({'postCode':'2'}).limit(1)
# for data in datas:
#     title = data['titleForeign']
#     contentWithTag = data['richTextForeign']
#     summary = data['contentForeign']
#     dic_info = {
#         'title':title,
#         # 'summary':summary,
#         'contentWithTag':contentWithTag
#     }
#     headers = {
#         'Content-Type': 'application/json',
#     }
#     dic_info_ = json.dumps(dic_info)
#     # print(dic_info_)
#     # with open('./data.json','w') as f:
#     #     f.write(dic_info_)
#     # break
#     # req = requests.post('http://192.168.1.236:5000/translate',data=dic_info_,headers=headers)
#     req = requests.post('http://117.78.23.14:5000/translate',data=dic_info_,headers=headers)
#     log.info(req.text)

# import re, datetime
#
#
# def paserTime(publishtime):
#     timeType = ['年前', '月前', '周前', '前天', '昨天', '天前', '今天', '小时前', '分钟前']
#     current_datetime = datetime.datetime.now()
#     publishtime = publishtime.strip()
#     print(publishtime)
#
#     try:
#         if '年前' in publishtime:
#             numbers = re.findall(r'\d+', publishtime)
#             day = int(numbers[0])
#             delta = datetime.timedelta(days=365 * day)
#             publishtime = current_datetime - delta
#         elif '月前' in publishtime:
#             numbers = re.findall(r'\d+', publishtime)
#             day = int(numbers[0])
#             delta = datetime.timedelta(months=day)
#             publishtime = current_datetime - delta
#         elif '周前' in publishtime:
#             numbers = re.findall(r'\d+', publishtime)
#             day = int(numbers[0])
#             delta = datetime.timedelta(weeks=day)
#             publishtime = current_datetime - delta
#         elif '天前' in publishtime:
#             numbers = re.findall(r'\d+', publishtime)
#             day = int(numbers[0])
#             delta = datetime.timedelta(days=day)
#             publishtime = current_datetime - delta
#         elif '前天' in publishtime:
#             delta = datetime.timedelta(days=2)
#             publishtime = current_datetime - delta
#         elif '昨天' in publishtime:
#             current_datetime = datetime.datetime.now()
#             delta = datetime.timedelta(days=1)
#             publishtime = current_datetime - delta
#         elif '今天' in publishtime or '小时前' in publishtime or '分钟前' in publishtime:
#             if '小时' in publishtime:
#                 hour = publishtime.split("小时")[0]
#             else:
#                 hour = 0
#             if hour != 0:
#                 min = publishtime.split("小时")[1].split("分钟")[0]
#             else:
#                 min = publishtime.split("分钟")[0]
#
#             delta = datetime.timedelta(hours=int(hour), minutes=int(min))
#             publishtime = current_datetime - delta
#         elif '年' in publishtime and '月' in publishtime:
#             time_format = '%Y年%m月%d日'
#             publishtime = datetime.datetime.strptime(publishtime, time_format)
#         elif '月' in publishtime and '日' in publishtime:
#             current_year = current_datetime.year
#             time_format = '%Y年%m月%d日'
#             publishtime = str(current_year) + '年' + publishtime
#             publishtime = datetime.datetime.strptime(publishtime, time_format)
#     except Exception as e:
#         print('时间解析异常！！')
#     return publishtime
#
# if __name__ == "__main__":
#     publishtime_ = '1小时17分钟前'
#     publish_time = paserTime(publishtime_).strftime("%Y-%m-%d")
#     print(publish_time)

# import pandas as pd
#
# # 创建一个示例DataFrame
# df = pd.DataFrame({'A': [1, 2, 3], 'B': [4, 5, 6]})
#
# # 要追加的行
# new_rows = pd.DataFrame({'A': [4, 5], 'B': [7, 8]})
#
# # 追加行到原DataFrame
# df = pd.concat([df, new_rows], ignore_index=True)
#
# print(df)

# import pandas as pd
#
# # 假设我们有两个DataFrame
# df1 = pd.DataFrame({'A': [1, 2, 3], 'B': [4, 5, 6]})
# df2 = pd.DataFrame({'A': [7, 8, 9], 'B': [10, 11, 12]})
#
# # 从df1中取出第一行数据
# row_to_append = df1.iloc[0].to_frame().T
# # print(row_to_append)
#
# # 将这一行数据追加到df2中
# # 注意：这里使用ignore_index=True来忽略索引，并重新设置索引
# # df2 = df2.append(row_to_append, ignore_index=True)
# df2 = pd.concat([df2, row_to_append], ignore_index=True)
#
# # 打印结果
# print(df2)


# import openpyxl
# import redis
#
# # 连接到Redis服务器
# redis_client = redis.Redis(host="114.116.90.53", port=6380, password='clbzzsn', db=6)
#
# # 打开Excel文件
# workbook = openpyxl.load_workbook('D:\\kkwork\\企业数据\\年报数据任务.xlsx')
#
# # 选择要读取的工作表
# worksheet = workbook['系统批量导出年报名单']
#
# # 选择要读取的列
# column_index = 0  # 选择第2列
#
# # 遍历指定列的单元格，并将值放入Redis列表
# for row in worksheet.iter_rows(values_only=True):
#     try:
#         cell_value = row[1] + "|" + row[2]
#     except:
#         print(row[1])
#         continue
#     # cell_value = row[1]
#     redis_client.rpush('NianBao:socialcode', cell_value)
#
# # 关闭Excel文件
# workbook.close()


# def find_empty_id_sequences(id_list):
#     empty_id_count = 0
#     empty_id_sequences = []
#     current_sequence = []
#
#     for id in id_list:
#         if id is None:  # 假设 id 为 None 表示空
#             empty_id_count += 1
#             current_sequence.append(empty_id_count)
#         else:
#             if empty_id_count > 0:
#                 empty_id_sequences.append(current_sequence)
#                 current_sequence = []
#             empty_id_count = 0
#
#     if empty_id_count > 0:
#         empty_id_sequences.append(current_sequence)
#
#     return empty_id_sequences
#
# # 示例使用
# id_list = [1, None, 2, None, None, 3, None, None, None, 4]
# empty_id_sequences = find_empty_id_sequences(id_list)
# print(empty_id_sequences)


# def process_results(results):
#     # 初始化输出字符串和上一个结果
#     final_output = ""
#     previous_res = None
#
#     # 初始化连续空的结果索引列表
#     empty_indices = []
#     empty_id_sequences = []
#     all_result = []
#     # 对结果进行排序
#     sorted_results = sorted(results.items(), key=lambda x: int(x[0].split(".")[0]))
#
#     # 遍历排序后的结果
#     for index, (_, res) in enumerate(sorted_results):
#         if res == '':
#             # 如果是空结果，将索引添加到空结果索引列表中
#             empty_indices.append(_)
#
#         else:
#             # 如果结果非空，并且连续空的结果列表不为空，
#             # 则添加连续空的结果索引列表到输出中
#             if empty_indices:
#                 # final_output += " ".join(map(str, empty_indices)) + '\n'
#                 empty_id_sequences.append(empty_indices)
#                 all_result.append(empty_indices)
#                 empty_indices = []
#             # 如果是非空结果并且与上一个结果不同，则添加到输出中
#             if res != previous_res:
#                 final_output += res + '\n'
#                 all_result.append(res)
#                 previous_res = res
#
#     return all_result, empty_id_sequences
#
# # 示例使用
# results = {
#     "1.0": "",
#     "2.0": "",
#     "3.0": "result1",
#     "4.0": "",
#     "5.0": "",
#     "6.0": "result2",
#     "7.0": "result2",
#     "8.0": "",
#     "9.0": "result3"
# }
#
# all_result, empty_id_sequences, dic_index = process_results(results)
# print(all_result)
# print(empty_id_sequences)
# print(dic_index)
import Levenshtein
def same_rule(same_list):
    # 记录最长的一个
    max_len = 0

    for item in same_list:
        if len(item) > max_len:
            max_len = len(item)

    char_map_list = []
    char_map_score = []
    for i in range(max_len):
        char_map_list.append(dict())
        char_map_score.append(dict())

    for index in range(max_len):
        for i in range(len(same_list)):
            if index < len(same_list[i]):
                char = same_list[i][index]
                score = same_list[i][index]
            else:
                char = ""
                score = 1

            if char not in char_map_list[index]:
                char_map_list[index][char] = 1
            else:
                char_map_list[index][char] += 1

            if char not in char_map_score[index]:
                char_map_score[index][char] = score
            else:
                char_map_score[index][char] += score

    print(char_map_list)
    print(char_map_score)

    #返回个数多的；当个数相同时，返回打分高的
    result = []
    for i in range(max_len):
        print('---------------')
        print(char_map_list[i].items())
        print(sorted(char_map_list[i].items(), key=lambda item:item[1], reverse=True))
        result.append(sorted(char_map_list[i].items(), key=lambda item:item[1],reverse=True)[0][0])
    return "".join(result)

def aaaaa(final_output):
    finall_list = []
    same_list = []
    # 处理相似的
    for result in final_output:
        print(f"result:{result}")
        if len(same_list) > 0:
            ratio = Levenshtein.ratio(result, same_list[-1])
            if ratio < 0.5:
                # 差异大于0.5
                # 对相似的做处理
                if len(same_list) > 1:
                    result_ = max(same_list, key=lambda x: (len(x), x))
                    same_list = [result_]
                    finall_list[-1] = result_
                    finall_list.append(result)

                else:
                    same_list = [result]
                    finall_list.append(result)
            else:
                same_list.append(result)

        else:
            same_list.append(result)
            finall_list.append(result)
    print(finall_list)

def paserTime(publishtime):
    timeType = ['年前', '月前', '周前', '前天', '昨天', '天前', '今天', '小时前', '分钟前']
    current_datetime = datetime.datetime.now()
    publishtime = publishtime.strip()
    print(publishtime)
    try:
        if '年前' in publishtime:
            numbers = re.findall(r'\d+', publishtime)
            day = int(numbers[0])
            delta = datetime.timedelta(days=365 * day)
            publishtime = current_datetime - delta
        elif '月前' in publishtime:
            numbers = re.findall(r'\d+', publishtime)
            day = int(numbers[0])
            delta = datetime.timedelta(days=30 * day)
            publishtime = current_datetime - delta
        elif '周前' in publishtime:
            numbers = re.findall(r'\d+', publishtime)
            day = int(numbers[0])
            delta = datetime.timedelta(weeks=day)
            publishtime = current_datetime - delta
        elif '天前' in publishtime:
            numbers = re.findall(r'\d+', publishtime)
            day = int(numbers[0])
            delta = datetime.timedelta(days=day)
            publishtime = current_datetime - delta
        elif '前天' in publishtime:
            delta = datetime.timedelta(days=2)
            publishtime = current_datetime - delta
        elif '昨天' in publishtime:
            current_datetime = datetime.datetime.now()
            delta = datetime.timedelta(days=1)
            publishtime = current_datetime - delta
        elif '今天' in publishtime or '小时前' in publishtime or '分钟前' in publishtime:
            delta = datetime.timedelta(hours=5)
            publishtime = current_datetime - delta
        elif '年' in publishtime and '月' in publishtime:
            time_format = '%Y年%m月%d日'
            publishtime = datetime.datetime.strptime(publishtime, time_format)
        elif '月' in publishtime and '日' in publishtime:
                current_year = current_datetime.year
                time_format = '%Y年%m月%d日'
                publishtime = str(current_year) + '年' + publishtime
                publishtime = datetime.datetime.strptime(publishtime, time_format)
    except Exception as e:
        print('时间解析异常！！')
    return publishtime


if __name__ == '__main__':

    #
    # # aaa = aaaaa(same_list)
    #
    # #
    # # for i in range(len(same_list)):
    # #     print(i, same_list[i])
    # #
    # # isHandleSuccess, handleMsg = True, "success"
    # # for i in range(3):
    # #     if i <= 3:
    # #         HandleSuccess, handleMsg = True, "success"
    # #     else:
    # #         HandleSuccess, handleMsg = False, "error"
    # #     print(i, HandleSuccess, handleMsg)
    # import re
    # import time
    #
    # import pandas as pd
    # import pymongo
    # import redis
    #
    # r = redis.StrictRedis(host='114.115.221.202', port=6379, db=1, decode_responses=True, password='clbzzsn')
    # db_storage = pymongo.MongoClient('mongodb://114.115.221.202:27017/', username='admin', password='ZZsn@9988').ZZSN[
    #     '裁员数据']
    # # typeList = ['2023年福布斯','2022年福布斯','独角兽','世界500','欧盟']
    # # for type in typeList:
    # #     par = re.compile(type)
    # # datas = db_storage.find({'flg': False, '内容-翻译': ''})
    # # for data in datas:
    # #     r.rpush('translation:downsiz', str(data['_id']))
    # #     print(data)
    # dataList = []
    # par = re.compile('独角兽')
    # datas = db_storage.find({'flg':True,'所在榜单排名':par})
    # for data in datas:
    #     del data['_id']
    #     del data['flg']
    #     dataList.append(data)
    # pd.DataFrame(dataList).to_excel('./独角兽.xlsx')
    # from base import BaseCore
    # basecore = BaseCore.BaseCore()
    # header = {
    #     'Accept': 'application/json, text/plain, */*',
    #     'Accept-Language': 'zh-CN,zh;q=0.9',
    #     'Connection': 'keep-alive',
    #     'Content-Type': 'application/json',
    #     'Sec-Fetch-Dest': 'empty',
    #     'Sec-Fetch-Mode': 'cors',
    #     'Sec-Fetch-Site': 'same-site',
    #     'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36',
    #     'X-AUTH-TOKEN': 'eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIxMzYzNjcxMTc0NiIsImlhdCI6MTcxNDk1Njg3MywiZXhwIjoxNzE3NTQ4ODczfQ.qMEvtETT7RS3Rhwq9idu5H2AKMxc2cjtr5bDDW6C6yOFKR-ErgDwT4SOBX9PB2LWDexAG2hNaeAvn6swr-n6VA',
    #     'X-TYCID': 'dad485900fcc11ee8c0de34479b5b939',
    #     'sec-ch-ua': '"Chromium";v="124", "Google Chrome";v="124", "Not-A.Brand";v="99"',
    #     'sec-ch-ua-mobile': '?0',
    #     'sec-ch-ua-platform': '"Windows"',
    #     'version': 'TYC-Web'
    # }
    # header = {
    #     # 'Accept': 'application/json, text/plain, */*',
    #     'Accept-Language': 'zh-CN,zh;q=0.9',
    #     'Connection': 'keep-alive',
    #     'Content-Type': 'application/json',
    #     # 'Sec-Fetch-Dest': 'empty',
    #     # 'Sec-Fetch-Mode': 'cors',
    #     # 'Sec-Fetch-Site': 'same-site',
    #     'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36',
    #     'X-AUTH-TOKEN': 'eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIxMzYzNjcxMTc0NiIsImlhdCI6MTcxNDk1Njg3MywiZXhwIjoxNzE3NTQ4ODczfQ.qMEvtETT7RS3Rhwq9idu5H2AKMxc2cjtr5bDDW6C6yOFKR-ErgDwT4SOBX9PB2LWDexAG2hNaeAvn6swr-n6VA',
    #     'X-TYCID': 'dad485900fcc11ee8c0de34479b5b939',
    #     # 'sec-ch-ua': '"Chromium";v="124", "Google Chrome";v="124", "Not-A.Brand";v="99"',
    #     # 'sec-ch-ua-mobile': '?0',
    #     # 'sec-ch-ua-platform': '"Windows"',
    #     'version': 'TYC-Web'
    # }
    # ip = basecore.get_proxy()
    # url = 'https://capi.tianyancha.com/cloud-listed-company/listed/holder/hk?&date=&gid=2348871426&sortField=&sortType=-100&pageSize=10&pageNum=1&percentLevel=-100&keyword='
    # # url = 'https://capi.tianyancha.com/cloud-listed-company/listed/holder/topTen?_=1716458307394&type=1&gid=4845825&sortField=&sortType=-100&pageSize=10&pageNum=1'
    # # url = 'https://capi.tianyancha.com/cloud-company-background/companyV2/dim/holderV2?_=1716534254189'
    # # payload = {"gid":"2350084808","pageSize":10,"pageNum":1,"sortField":"","sortType":"-100","historyType":1,"percentLevel":"-100","keyword":""}
    # # req = requests.post(url=url, headers=header, data=json.dumps(payload), proxies=ip)
    # req = requests.get(url=url, headers=header, proxies=ip)
    # print(req.json())
    # req.close()


    # headers = {
    #     'Accept':
    #     'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7',
    #     'Accept-Encoding': 'gzip, deflate',
    #     'Accept-Language': 'zh-CN,zh;q=0.9',
    #     'Cache-Control': 'max-age=0',
    #     'Connection': 'keep-alive',
    #     'Content-Length': '367',
    #     'Content-Type': 'application/x-www-form-urlencoded',
    #     'Cookie':
    #     'acw_tc=2760825217168606497214655ec9cb62ffa696c5367ec9f402d2086a0287ae; tgw_l7_route=125d8c38fe1eb06650b04b0cc6f51270',
    #     'Host': 'eid.csrc.gov.cn',
    #     'Origin': 'http://eid.csrc.gov.cn',
    #     'Referer': 'http://eid.csrc.gov.cn/101812/index_f.html',
    #     'Upgrade-Insecure-Requests': '1',
    #     'User-Agent':
    #     'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36'
    # }
    # payload = {'prodType': '002598', 'prodType2': '代码/简称/拼音缩写 ', 'keyWord': '', 'keyWord2': '关键字', 'startDate': '',
    #      'startDate2': '请输入开始时间', 'endDate': '', 'endDate2': '请输入结束时间', 'selCatagory2': '10057', 'selBoardCode0': '',
    #      'selBoardCode': ''}
    # req = requests.get(url='http://eid.csrc.gov.cn/101812/index_2_f.html', headers=headers, data=payload)
    # print(req.status_code)
    publish_time = '2023年10月5日 '
    aaa = paserTime(publish_time)
    print(aaa)
