Skip to content

Commit 333bdce

Browse files
committed
fix: 无法正确获取活动id
1 parent baa6155 commit 333bdce

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

Auto/Full-Auto/作业搜索.py

+7-4
Original file line numberDiff line numberDiff line change
@@ -511,21 +511,24 @@ def get_activity_data():
511511
# Find all tables that match the criteria
512512
tables = soup.find_all('table', {'class': 'wikitable'})
513513
# Iterate through each table
514+
task_cat_three = ''
514515
for table in tables:
515516
rows = table.find_all('tr')
516-
for row1 in rows[1:]: # Skip the header row
517-
cols = row1.find_all('td')
517+
for row in rows[1:]: # Skip the header row
518+
cols = row.find_all('td')
518519
if len(cols) < 3:
519520
continue
520521
task_page = cols[0].find('a')
521522
if task_page:
522-
task_cat_three = task_page.get('title', [])
523+
task_cat_three = task_page.get('title', '')
523524
if "ST" in task_cat_three:
524525
continue
525-
if task_cat_three:
526+
if "-1" in task_cat_three:
526527
task_stage_id = get_cat_three_info(cat_three_dict, task_cat_three, "stage_id")
527528
activity_id = extract_activity_from_stage_id(task_stage_id)
528529
break
530+
if "-1" in task_cat_three:
531+
break
529532
elif status_span and "未开始" in status_span.text:
530533
status = "未开始"
531534
activities[activity_name] = {'status': status, 'id': activity_id}

0 commit comments

Comments
 (0)