modify scripts
This commit is contained in:
@ -120,7 +120,7 @@ def write_raw_html(href, html_text):
|
|||||||
|
|
||||||
|
|
||||||
# 保存抓取到的原始HTML,方便后续核验
|
# 保存抓取到的原始HTML,方便后续核验
|
||||||
def read_raw_html(href, expire_date="2025-03-01"):
|
def read_raw_html(href, expire_date_str="2025-03-01"):
|
||||||
# 获取目录
|
# 获取目录
|
||||||
id = extract_id_from_href(href)
|
id = extract_id_from_href(href)
|
||||||
if 'person.rme' in href.lower():
|
if 'person.rme' in href.lower():
|
||||||
@ -141,6 +141,7 @@ def read_raw_html(href, expire_date="2025-03-01"):
|
|||||||
# 将时间戳转换为 datetime 对象
|
# 将时间戳转换为 datetime 对象
|
||||||
last_modified_date = datetime.fromtimestamp(last_modified_timestamp)
|
last_modified_date = datetime.fromtimestamp(last_modified_timestamp)
|
||||||
# 检查文件最后修改时间是否晚于给定日期
|
# 检查文件最后修改时间是否晚于给定日期
|
||||||
|
expire_date = datetime.strptime(expire_date_str, "%Y-%m-%d")
|
||||||
if last_modified_date > expire_date:
|
if last_modified_date > expire_date:
|
||||||
logging.debug(f"find local file on href {href}")
|
logging.debug(f"find local file on href {href}")
|
||||||
with open(full_path, 'r', encoding='utf-8') as file:
|
with open(full_path, 'r', encoding='utf-8') as file:
|
||||||
|
|||||||
Reference in New Issue
Block a user