🐛 Fix calendar model parse (#6)

Co-authored-by: brian <brian@xtaolabs.com>
This commit is contained in:
brian 2023-03-17 23:49:22 +08:00 committed by GitHub
parent 17b1f9bd55
commit f64e072552
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View File

@ -58,7 +58,7 @@ def parse_courses(jw_html: str) -> List[AiCourse]:
soup = BeautifulSoup(jw_html, "lxml")
trs = [i for i in soup.find_all("tr") if i.find("td", {"class": "td"})][:9]
for tr in trs:
tds = tr.find_all("td")[2:]
tds = tr.find_all("td", {"class": "td"})
for index, td in enumerate(tds):
divs = td.find_all("div")
for div in divs:

View File

@ -14,7 +14,7 @@ class AiCourse(BaseModel):
@property
def key(self):
return f"{','.join([str(i) for i in self.weeks])}_{self.day}_{self.sections}"
return f"{','.join([str(i) for i in self.weeks])}_{self.day}_{self.start_num}"
@property
def second_key(self):

View File

@ -5,7 +5,7 @@ with open("README.md", "r", encoding="utf-8") as fh:
setuptools.setup(
name="cqwu", # 用自己的名替换其中的YOUR_USERNAME_
version="0.0.6", # 包版本号,便于维护版本
version="0.0.7", # 包版本号,便于维护版本
author="omg-xtao", # 作者,可以写自己的姓名
author_email="xtao@xtaolink.cn", # 作者联系方式,可写自己的邮箱地址
description="A cqwu ehall client.", # 包的简述