mirror of
https://github.com/cqwu-ehall/cqwu-ehall.git
synced 2024-11-22 11:01:20 +00:00
🐛 Fix calendar model parse (#6)
Co-authored-by: brian <brian@xtaolabs.com>
This commit is contained in:
parent
17b1f9bd55
commit
f64e072552
@ -58,7 +58,7 @@ def parse_courses(jw_html: str) -> List[AiCourse]:
|
|||||||
soup = BeautifulSoup(jw_html, "lxml")
|
soup = BeautifulSoup(jw_html, "lxml")
|
||||||
trs = [i for i in soup.find_all("tr") if i.find("td", {"class": "td"})][:9]
|
trs = [i for i in soup.find_all("tr") if i.find("td", {"class": "td"})][:9]
|
||||||
for tr in trs:
|
for tr in trs:
|
||||||
tds = tr.find_all("td")[2:]
|
tds = tr.find_all("td", {"class": "td"})
|
||||||
for index, td in enumerate(tds):
|
for index, td in enumerate(tds):
|
||||||
divs = td.find_all("div")
|
divs = td.find_all("div")
|
||||||
for div in divs:
|
for div in divs:
|
||||||
|
@ -14,7 +14,7 @@ class AiCourse(BaseModel):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def key(self):
|
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
|
@property
|
||||||
def second_key(self):
|
def second_key(self):
|
||||||
|
2
setup.py
2
setup.py
@ -5,7 +5,7 @@ with open("README.md", "r", encoding="utf-8") as fh:
|
|||||||
|
|
||||||
setuptools.setup(
|
setuptools.setup(
|
||||||
name="cqwu", # 用自己的名替换其中的YOUR_USERNAME_
|
name="cqwu", # 用自己的名替换其中的YOUR_USERNAME_
|
||||||
version="0.0.6", # 包版本号,便于维护版本
|
version="0.0.7", # 包版本号,便于维护版本
|
||||||
author="omg-xtao", # 作者,可以写自己的姓名
|
author="omg-xtao", # 作者,可以写自己的姓名
|
||||||
author_email="xtao@xtaolink.cn", # 作者联系方式,可写自己的邮箱地址
|
author_email="xtao@xtaolink.cn", # 作者联系方式,可写自己的邮箱地址
|
||||||
description="A cqwu ehall client.", # 包的简述
|
description="A cqwu ehall client.", # 包的简述
|
||||||
|
Loading…
Reference in New Issue
Block a user