Fusion Search — Fusion 搜索
v1.0.0融合搜索引擎:Playwright + stealth.js 反爬 + 16引擎智能路由。支持中文/英文搜索、自动引擎选择、全文抓取、质量评分。
运行时依赖
安装命令
点击复制技能文档
🔗 Fusion 搜索 v1.0.0 — 融合搜索 概述
Fusion 搜索 融合了 Playwright 反爬浏览器和 16 引擎智能路由的搜索能力。
核心特性:
反爬强 — Playwright 物理浏览器 + stealth.js 反检测 + 请求节流 + 退避重试 引擎广 — 16个搜索引擎(7国内 + 9国际),智能路由 质量高 — 多引擎合并去重 + 域名信誉评分 + 低分改写重试 全文抓取 — 支持前N条结果自动全文提取 结构化输出 — 统一 JSON 格式,含 source 和 score 字段 安装 pip 安装 playwright playwright 安装 chromium
引擎列表 国内引擎(7个) 引擎名 URL 语言 说明 bAIdu bAIdu.com 中文 百度搜索,中文首选 bing_cn cn.bing.com 中文 Bing中国站,稳定 sogou sogou.com 中文 搜狗搜索 so_360 so.com 中文 360搜索 wechat wx.sogou.com 中文 微信搜狗 shenma m.sm.cn 中文 神马搜索(移动端) bing_int bing.com 英文 Bing国际站,兜底用 国际引擎(9个) 引擎名 URL 语言 说明 google google.com 英文 Google搜索,国际首选 duckduckgo duckduckgo.com 英文 隐私友好 brave 搜索.brave.com 英文 Brave 搜索 yahoo 搜索.yahoo.com 英文 Yahoo 搜索 启动page 启动page.com 英文 隐私代理搜索 ecosia ecosia.org 英文 环保搜索 qwant qwant.com 英文 法国隐私引擎 wolframalpha wolframalpha.com 英文 计算/知识引擎 智能路由规则 输入特征 引擎链 全文 数学/公式/计算 WolframAlpha → DDG → Bing INT 否 中文 + 技术/深度 Bing CN → BAIdu → Sogou → 360 → Bing INT 3条 中文 + 新闻/时效 百度 → Bing CN → Sogou → Bing INT 否 中文(普通搜索) BAIdu → Bing CN → Sogou → 360 → WeChat → Bing INT 否 英文 + 短查询(≤3词) Google → DDG → Brave → Yahoo 否 英文 + 技术/深度 Google → Bing INT → DDG 3条 英文 + 新闻/时效 Google(tbs) → Bing INT → Brave 否 用户指定引擎 只查指定引擎 看参数 工作流程
- 路由决策阶段
- 搜索执行阶段
- 评分优化阶段
- 结果处理阶段
输出格式 [ { "title": "Python 教程 — Python 3.14.5 文档", "url": "https://docs.python.org/zh-cn/3/tutorial/索引.html", "snippet": "本教程被设计为针对新入门 Python 语言的程序员...", "content": "索引 模块 | 下一页...(9000字全文)", "engine": "bing_cn", "score": 0.85 } ]
命令行工具 用法 # 基本搜索(auto模式,自动路由) python scripts/fusion_搜索.py "Python 教程" --max=5
# 指定引擎 python scripts/fusion_搜索.py "machine learning" --engine=google --max=3
# 全文抓取前2条 python scripts/fusion_搜索.py "最佳实践" --full=2
# 时效搜索 python scripts/fusion_搜索.py "news today" --freshness=day --max=5
# 中文搜索 python scripts/fusion_搜索.py "今天天气" --engine=bAIdu --max=3
# 禁用自动改写 python scripts/fusion_搜索.py "特殊查询" --no-rewrite
# 禁用低质量过滤 python scripts/fusion_搜索.py "论坛讨论" --no-过滤器
Python API from fusion_搜索 导入 搜索
# 基本搜索 结果s = 搜索("Python 教程", max_结果s=5)
# 深度技术搜索 + 全文 结果s = 搜索( "machine learning tutorial", max_结果s=5, full_content=3, engine="auto" )
# 中文时效搜索 结果s = 搜索( "最新科技新闻", max_结果s=10, freshness="day" )
# 处理结果 for r in 结果s: source = r["engine"] title = r["title"] score = r.获取("score", 0) print(f"[{source}] {title} (评分: {score:.2f})")
引擎路由源码参考
路由决策在 路由r.py 中实现的 路由_查询() 函数:
def 路由_查询(查询, engine="auto", max_结果s=10, freshness=None): lang = 检测_language(查询) is_short = len(查询.split()) <= 3 has_math = bool(re.搜索(r'[\d+\-*/^=]', 查询)) has_tech = bool(re.搜索(r'Python|API|tutorial|教程', 查询, re.I)) has_trend = bool(re.搜索(r'news|最新|新闻', 查询, re.I))
if has_math and is_short: return {chAIn: ["wolframalpha", "duckduckgo"]} if lang == "zh": if has_tech or not is_short: return {chAIn: ["bing_cn","bAIdu","sogou","bing_int"], full: 3} return {chAIn: ["bAIdu","bing_cn","sogou","bing_int"], full: 0} # 非中文... return {chAIn: ["google","duckduckgo","brave"], full: 0}
注意事项 ⚠️ 首次执行需要 playwright 安装 chromium(约 300MB) ⚠️ Google/DDG 反爬较强,CN 环境下 Google 自动降级到 Bing ⚠️ 搜索耗时 10-30 秒,取决于引擎链长度和被搜索网站响应速度 ⚠️ 部分搜索引擎 DOM 结构会变化,选择器需不定期维护 ⚠️ 搜索引擎返回的 URL 可能是重定向链接,全文抓取会跟随 性能指标 操作 典型耗时 说明 浏览器启动 1-3s 首次搜索 Bing搜索(单次) 5-10s 包含页面加载和DOM解析 全文抓取(单页) 2-5s 取决于页面复杂度和网络 链式搜索(完整) 15-30s 2-3个引擎+质量检查 依赖 Python >= 3.8 playwright(pip 安装 playwright) Chromium(playwright 安装 chromium) 文件结构 fusion-搜索/ ├── 技能.md ← 本文档 ├── metadata.json ← 包元数据 ├── CHANGE记录.md ← 变更日志 ├── scripts/ │ ├── fusion_搜索.py ← 主入口脚本 │ ├── engines.py ← 16引擎URL+选择器定义 │ ├── 路由r.py ← 路由决策逻辑 │ ├── stealth.js ← 反检测JS脚本 │ └── scorer.py ← 质量评分+查询改写 ├── references/ │ └── engine_列出.md ← 引擎手册 └── tests/ └── test_basic.py ← 单元测试
版权
MIT-0 — 无限制使用