Back to skills
SKILL.md
532 Cnfinancialscraper
ASecurity中国金融机构数据爬取工具。全量金融机构名单(1330家,27大类)、A股报告爬取(年报+券商研报+公告)、 产品解析(基金/ETF/FOF/股票/债券)、新闻资讯、反爬+双语展示、金融文档分析整理。 v4.0 反爬增强:UA 轮换池(12种真实浏览器)、多策略自动重试、六级降级链、自适应限流、 域名健康熔断、请求指纹随机化、编码智能检测、JSON-LD 结构化数据提取、代理支持。 触发词:爬取机构、机构名单、网页爬取、产品解析、公告下载、券商研报、批量爬取、公司批量、文档分析、整理文档、文档对比、基金分析、净值查询
- 4 stars
- 0 votes
- 0 copies
- 0 views
- Added November 29, 2026
Works with
Security analysis
92/100- Installs packages at runtime which could introduce malicious dependencies
Pro scans all 19 files and shows the line behind each finding
npx -y skills add winlem2024/workbuddy-skills --skill 532-cnfinancialscraper --agent claude-codeAre you the author of 532 Cnfinancialscraper?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/winlem2024-532-cnfinancialscraper)---
name: cn-financial-scraper
description: |
中国金融机构数据爬取工具。全量金融机构名单(1330家,27大类)、A股报告爬取(年报+券商研报+公告)、
产品解析(基金/ETF/FOF/股票/债券)、新闻资讯、反爬+双语展示、金融文档分析整理。
v4.0 反爬增强:UA 轮换池(12种真实浏览器)、多策略自动重试、六级降级链、自适应限流、
域名健康熔断、请求指纹随机化、编码智能检测、JSON-LD 结构化数据提取、代理支持。
触发词:爬取机构、机构名单、网页爬取、产品解析、公告下载、券商研报、批量爬取、公司批量、文档分析、整理文档、文档对比、基金分析、净值查询
auto_trigger:
keywords: [爬取机构, 机构名单, 网页爬取, 产品解析, 公告下载, 券商研报, 研报导出,
批量爬取, 公司批量, 新闻资讯, 上市公司报告, 机构更新, 金融数据, 文档分析, 整理文档,
文档对比, 基金分析, 基金净值, 净值查询, 年报, 季报, 半年报, 股票分析, 产品对比, 机构查询]
patterns:
- "(爬取|获取|下载|查看) (机构|报告|公告|研报|新闻|产品|数据|净值)"
- "(解析|分析|查看|查询|对比) (基金|ETF|FOF|股票|债券|产品)"
- "(机构|券商|银行|基金公司) (名单|信息|数据|列表|查询)"
- "(搜索|查询|查看) (机构|公告|研报|报告|年报|季报|半年报)"
- "(导出|下载) (报告|PDF|PPT|Excel|Word)"
- "(分析|整理|对比) (文档|PDF|Word|研报|年报|报告)"
- "(净值|收益|业绩).*(查询|查看|分析)"
- "(年报|季报|半年报).*(下载|查看|搜索)"
---
# cn-financial-scraper 金融数据爬虫
> 全量机构名单(1330家/27大类) | A股报告爬取 | 券商研报 | 公告下载 | 产品解析 | **v4.0 增强反爬** | 金融文档分析 | 实时行情 | 可转债
**标准安装**:`python setup_env.py` 自动安装依赖,或 `pip install -r requirements.txt`。可选增强:`scrapling`(JS 动态渲染)、`playwright`(浏览器自动化)、`chardet`(高精度编码检测),未安装不影响核心功能。
## 快速上手
```python
# 1. 查询机构名单
from scripts import search_institution
print(search_institution("华夏基金"))
# 2. 解析金融产品(基金/ETF/FOF/股票/债券)
from scripts import parse_financial_product
info = parse_financial_product("https://fund.eastmoney.com/000001.html", "fund")
# 3. 导出报告(标准库 fallback,零三方依赖)
from scripts import ComprehensiveReportManager, ComprehensiveExporter
data = ComprehensiveReportManager().get_all_reports("600519") # 贵州茅台
ComprehensiveExporter().export_all_formats(data, "600519")
```
## 功能要点
### 🛡️ v4.0 反爬增强(新增)
| 特性 | 说明 |
|------|------|
| **UA 轮换池** | 12 种真实浏览器 UA(Chrome/Edge/Firefox 桌面+移动),自动轮换,按域名记忆最优 UA |
| **多策略重试** | 每次重试自动换策略:换 UA → 换指纹 → 添加 X-Requested-With → 模拟移动端 → 增加延迟 |
| **六级降级链** | Scrapling隐身 → Scrapling移动 → Playwright JS渲染 → http_utils桌面 → http_utils移动 → 过期缓存 |
| **自适应限流** | 遇到 HTTP 429/503 自动加大延迟,成功后逐步恢复 |
| **域名健康熔断** | 连续失败 ≥3 次自动暂停该域名 60 秒,半开后探测恢复 |
| **请求指纹随机化** | Accept-Language / Accept-Encoding / Sec-Ch-Ua 每次随机组合 |
| **编码智能检测** | 四级检测:Content-Type → HTML meta charset → chardet(可选)→ 中文编码试探 |
| **JSON-LD 提取** | 自动提取 `<script type="application/ld+json">` 结构化数据作为解析 fallback |
| **自适应选择器** | 自动学习每个网站当前有效的 CSS 选择器,缓存至本地 |
| **代理支持** | `set_proxy()` 设置全局代理,`check_proxy()` 检测可用性 |
### 如何使用反爬特性
```python
from scripts.http_utils import get_session, http_get, set_proxy
# 开启 UA 轮换 + 指纹随机化(v4.0 默认开启)
session = get_session(rotate_ua=True, randomize_fingerprint=True)
# 设置代理(可选)
set_proxy("http://127.0.0.1:7890")
# 自定义重试策略
from scripts.http_utils import RetryStrategy, http_get
resp = http_get(url, retries=5, retry_strategies=[
RetryStrategy.UA_ROTATE,
RetryStrategy.FINGERPRINT,
RetryStrategy.ADD_AJAX_HEADER,
RetryStrategy.MOBILE_UA,
RetryStrategy.DELAY_INCREASE,
])
```
### 原有功能
- **机构名单**:1330 家 / 27 大类,统一注册表 `data/institution_registry.json`(含 URL);`python -m scripts.scrapable_registry search 华夏`
- **报告爬取**:券商研报(评级/分析师/目标价)、上市公司年报/季报/半年报、公告搜索 + PDF 下载、SQLite 全量索引 + 断点续扫
- **产品解析**:`web_parser.py` 支持基金 / ETF / FOF / 股票 / 债券 / 投顾组合
- **批量爬取**:`BatchInstitutionCrawler` 并发爬取 + 断点续爬
- **文档分析**:`document_analyzer.py` 单文档深度分析、批量整理目录、多文档对比
- **报告导出**:PPT / PDF / Word / Excel,标准库 fallback 无需 python-docx/pptx/openpyxl
- **多源数据**:新浪财经实时行情、天天基金净值、财联社电报、集思录可转债、华尔街见闻、沪深交易所
- **数据维护**:`institution_updater.py` 每季度更新机构名单;`python scripts/data_validator.py` 验证数据完整性
## 提高爬取成功率
1. **安装可选依赖**:`pip install scrapling playwright chardet && playwright install chromium`
2. **使用代理**:`set_proxy("http://your-proxy:port")` 避免 IP 被封
3. **调整限流**:大规模爬取时降低并发、增加延迟
4. **利用降级链**:核心 API 自动回退,无需手动干预
5. **开启缓存**:`use_cache=True`(默认开启)避免重复请求被限
## MCP 工具
通过 MCP 协议暴露 **20 个工具**,覆盖机构查询、网页/机构爬取、产品解析、新闻/公告/研报、文档分析与对比、报告导出、实时行情、基金净值、财联社电报、可转债数据等。完整列表与用法见 [README.md](README.md)。
## 详细文档
完整功能说明、4 个实战场景、27 类机构清单、进阶配置、能力边界、FAQ 故障排除、MCP 工具表均见 [README.md](README.md)。
Files in this skill
- README.md
- SKILL.md
- _meta.json
- _skillhub_meta.json
- data/aic_list.json
- data/auto_finance_list.json
- data/city_commercial_bank_list.json
- data/city_investment_list.json
- data/consumer_finance_list.json
- data/finance_company_list.json
- data/financial_holding_list.json
- data/financial_lease_list.json
- data/financing_guarantee_list.json
- data/foreign_institution_list.json
- data/fund_company_list.json
- data/fund_subsidiary_list.json
- data/futures_list.json
- data/futures_risk_mgmt_list.json
- data/institutions.json
Attribution
Related skills
View all in development →Comments
Loading comments…
Newsletter
Get the weekly list of safe new skills, and the ones we pulled.