py_spider/README.md
ZZY 34770cfeff init: 添加 GLUT 学分统计爬虫项目
- 新增 README.md 文件,包含项目描述、初始化步骤和使用方法
- 添加 default.env 文件,用于配置环境变量
- 实现 glut.py,包含登录、获取成绩、解析成绩等功能
- 添加 index.html,提供 Web 界面展示成绩
- 实现 main.py,提供命令行接口
- 添加 requirements.txt,列出项目依赖
- 实现 server.py,提供 HTTP 服务接口
2024-12-12 22:13:16 +08:00

41 lines
782 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# GLUT spider web
- 项目描述
- 用于获取GLUT学分统计即爬虫案例
- 初始化项目
```shell
# Windows
python -m venv .venv
pip install -r requirements.txt
# Linux
python3 -m venv .venv
pip3 install -r requirements.txt
```
- 配置环境变量( **推荐配置** )
`default.env`内容填写完整后改名为`.env`
- 使用方法
```shell
# 帮助文档
python main.py -h
# 开启服务器
python main.py -s
# 使用命令行操作,如果没有配置环境变量则需要给出用户名和密码
# 注意默认会输出scores.json
> python main.py -t 2023_sp
Fetching scores for 2023 sp...
aggregate_score: 72.32824427480917
> python main.py -t 2023_sp -u 32220520xxxxx -p xxxxx
Fetching scores for 2023 sp...
aggregate_score: 72.32824427480917
```