国自然大数据平台智能爬虫 - AI驱动的基金项目数据采集工具
Project description
NSFC Spider - 国自然大数据平台智能爬虫
🕷️ AI驱动的国家自然科学基金项目数据采集工具
基于 browser-use 框架,使用大语言模型智能理解网页结构,自动适应页面变化。
特性
- 🤖 AI 驱动:使用 LLM 理解网页,自动适应页面变化
- 💬 对话式 CLI:交互式命令行界面
- 🔧 灵活配置:支持多种 LLM 提供商
- 📊 结构化输出:JSON/CSV/Markdown 格式导出
安装
方式一:使用 pip 安装(推荐)
pip install nsfc-spider
方式二:从源码安装
# 1. 克隆仓库
git clone https://github.com/yourusername/nsfc-spider.git
cd nsfc-spider
# 2. 安装依赖
pip install -e .
# 3. 安装 Playwright 浏览器
playwright install chromium
# 4. 配置环境变量
cp config/.env.example .env
# 编辑 .env 填入你的 API Key
快速开始
使用命令行工具
# 安装后直接运行
nsfc-spider
# 或使用 Python 模块方式
python -m nsfc_spider.cli
开发模式运行
# 从源码目录运行
cd nsfc-spider
python run.py
CLI 命令
nsfc> help # 查看帮助
nsfc> config # 配置 LLM 和浏览器
nsfc> search 智慧港口 # 搜索项目
nsfc> search 人工智能 -p 3 # 搜索并爬取3页
nsfc> task <自然语言任务> # 执行自定义任务
nsfc> status # 查看配置状态
nsfc> exit # 退出
支持的 LLM
- OpenAI (gpt-4o, gpt-4o-mini)
- Anthropic (claude-sonnet-4)
- DeepSeek
- Ollama (本地模型)
项目结构
nsfc-spider/
├── src/nsfc_spider/
│ ├── __init__.py
│ ├── agent.py # Agent 封装
│ ├── config.py # 配置管理
│ ├── cli/ # CLI 模块
│ └── tasks/ # 爬取任务
│ ├── direct_scraper.py # 直接爬取
│ ├── nsfc_search.py # AI搜索
│ ├── analyzer.py # 数据分析
│ ├── llm_filter.py # LLM筛选
│ └── review_generator.py # 综述生成
├── config/
│ └── .env.example
├── tests/ # 测试文件
├── docs/ # 文档
├── run.py # 开发入口
├── main.py # 打包入口
└── pyproject.toml # 项目配置
许可证
MIT License
贡献
欢迎提交 Issue 和 Pull Request!
更新日志
查看 CHANGELOG.md 了解版本更新历史。
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
nsfc_spider-0.1.0.tar.gz
(2.1 MB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nsfc_spider-0.1.0.tar.gz.
File metadata
- Download URL: nsfc_spider-0.1.0.tar.gz
- Upload date:
- Size: 2.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2a2281df1d83619f8b4a717865972517237e92fe97448fbd5fa7833b852f0640
|
|
| MD5 |
4f449399d97742454f399004b7f18310
|
|
| BLAKE2b-256 |
68c2dc0b658db05562d81ac9643c6ee0d0980a70c09dc900de1945554390991d
|
File details
Details for the file nsfc_spider-0.1.0-py3-none-any.whl.
File metadata
- Download URL: nsfc_spider-0.1.0-py3-none-any.whl
- Upload date:
- Size: 40.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c55b96c7b8fce81fd49dc112cf1c00865aa25b5d02ad06584fa148b4645e831c
|
|
| MD5 |
32f6418bebf2d0030ee166607df21607
|
|
| BLAKE2b-256 |
950c5e1276b74c0ab9dec89090ada03b09a1f463decee909d630212757eba4b0
|