通过 Windows curl.exe 直接请求搜索引擎页面,正则提取搜索结果。输出核心答案摘要 + 详细结果列表。
| 引擎 | 状态 |
|---|---|
| ------ | ------ |
| Bing (cn.bing.com) | ✅ 稳定可用 |
| 360 (so.com) | ❌ 被反爬 |
| 知乎 | ❌ 被反爬 |
当前有效引擎:Bing(主力,稳定出结果)
直接调用 Python 脚本:
run.py <关键词> [freshness] [count] [vertical]
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| ------ | ------ | ------ | ------ |
| query | string | 是 | 搜索关键词 |
| freshness | string | 否 | 预留参数(暂未实现) |
| count | number | 否 | 返回数量,默认10条 |
| vertical | string | 否 | news/tech/ent/shop(引擎组合略有不同) |
== [Search] 中东战争 ==
[Bing] +10
== [Core Answer] ==
摘要内容1
摘要内容2
== [Results: 10 | Bing + 360 + Zhihu] ==
1. [Bing] 标题
摘要
URL
subprocess.run(['curl.exe', ...]) 发 HTTP 请求re.finditer 正则提取搜索结果OrderedDict 按 URL 去重sys.stdout = io.TextIOWrapper(..., encoding='utf-8') 解决 Windows GBK 问题curl.exe 在系统 PATH 中可用openclaw tool call CLI 命令的依赖,改为直接用 curl 请求 Bing共 1 个版本