for li in root.find(“div”,class_=“text_part”).find(“ul”).find_all(“li”):
title = li.find(‘a’)[‘title’]
date = li.find(‘span’).string
notices.append((title,date))
with open(‘notices3.txt’,‘w’,encoding=‘utf-8’) as f:
for notice in notices:
f.write(f’{notice[0]},{notice[1]}\n’)
2021-06-08
最新推荐文章于 2021-08-06 14:28:27 发布