This commit is contained in:
ChuXun
2026-01-29 03:39:01 +08:00
parent 0da692ab97
commit d1dc08a16d
12 changed files with 1607 additions and 39 deletions

View File

@@ -1,5 +1,100 @@
# 常见问题解决方案
## 🚨 "未能提取到成绩信息,共 0 门课程" 错误
### 问题症状
日志中反复出现:
```
[WARNING] 未能提取到成绩信息,返回原始文本
[INFO] 成绩无变化(共 0 门课程)
```
### 快速诊断
#### 1. 检查 BeautifulSoup 是否安装
```bash
python3 -c "import bs4; print('BeautifulSoup4 已安装')"
```
如果报错,安装依赖:
```bash
pip3 install beautifulsoup4
# 或完整安装所有依赖
pip3 install -r requirements.txt
```
#### 2. 使用调试模式查看详细信息
```bash
cd ~/grade_monitor
python3 monitor.py --test --debug
```
查看输出中是否有:
- ✅ "找到成绩表格"
- ✅ "找到 X 行成绩数据"
- ✅ "共解析到 X 门课程"
如果都没有,继续下一步。
#### 3. 检查是否登录失效
查看日志是否有 "检测到登录页面" 错误:
```bash
grep "登录页面\|LOGIN_REQUIRED" ~/grade_monitor/monitor.log
```
如果有,重启服务重新登录:
```bash
systemctl restart grade-monitor
```
#### 4. 查看调试HTML文件
程序会自动保存问题页面到 `debug_page.html`
```bash
cd ~/grade_monitor
# 检查文件是否存在
ls -lh debug_page.html
# 查看是否包含成绩表格
grep -i "gridtable\|课程名称\|成绩" debug_page.html | head -5
```
### 解决方案
**方案1重新安装依赖并重启**
```bash
cd ~/grade_monitor
pip3 install -r requirements.txt
systemctl restart grade-monitor
tail -f monitor.log
```
**方案2启用调试模式监控**
编辑服务配置:
```bash
sudo nano /etc/systemd/system/grade-monitor.service
```
修改 ExecStart 行:
```ini
ExecStart=/usr/bin/python3 /home/yourusername/grade_monitor/monitor.py --debug
```
重新加载并重启:
```bash
sudo systemctl daemon-reload
sudo systemctl restart grade-monitor
tail -f ~/grade_monitor/monitor.log
```
**方案3如果是网页结构变化**
查看详细排查指南:
```bash
cat ~/grade_monitor/故障排查指南.md
```
---
## ⚠️ "请不要过快点击" 错误
### 问题原因