browser-web-search
v0.2.2
Published
把任何网站变成命令行 API,专为 OpenClaw 设计,复用浏览器登录态
Maintainers
Readme
Browser Web Search (BWS)
把任何网站变成命令行 API — 专为 OpenClaw 设计的轻量级浏览器自动化工具
特点
- 零配置 — 无需 Chrome Extension、无需 Daemon,开箱即用
- 复用登录态 — 使用浏览器中的登录状态,无需 API Key
- 13 个平台,41 个命令 — 覆盖搜索、社交、新闻、开发、视频、招聘等场景
- AI Agent 友好 — 结构化 JSON 输出,内置 jq 过滤
安装
npm install -g browser-web-search快速开始
bws site list # 查看所有命令
bws site toutiao/hot # 今日头条热榜
bws site xiaohongshu/search "旅行" # 小红书搜索
bws site zhihu/hot # 知乎热榜
bws site bilibili/popular # B站热门视频内置平台(13 个)
| 平台 | 说明 | 命令 |
|-----|------|-----|
| 今日头条 | 新闻资讯 | toutiao/hot, toutiao/search |
| 小红书 | 生活分享 | xiaohongshu/search, xiaohongshu/note, xiaohongshu/comments, xiaohongshu/user_posts |
| 36kr | 科技创投 | 36kr/newsflash |
| 知乎 | 问答社区 | zhihu/hot, zhihu/search, zhihu/question, zhihu/me |
| CSDN | 开发者社区 | csdn/search |
| 博客园 | 技术博客 | cnblogs/search |
| 豆瓣 | 影视书籍 | douban/movie, douban/search, douban/top250, douban/movie-hot, douban/movie-top, douban/comments |
| Bilibili | 视频弹幕 | bilibili/popular, bilibili/trending, bilibili/ranking, bilibili/search, bilibili/video, bilibili/comments, bilibili/feed, bilibili/history, bilibili/me |
| BOSS直聘 | 招聘平台 | boss/search, boss/detail |
| GitHub | 代码托管 | github/repo, github/issues, github/fork, github/pr-create, github/issue-create |
| Baidu | 百度搜索 | baidu/search |
| Bing | 必应搜索 | bing/search |
| Google | 谷歌搜索 | google/search |
命令参考
bws site list # 列出所有 adapter
bws site info <name> # 查看 adapter 详情
bws site <name> [args...] # 运行 adapter
bws site <name> --json # JSON 格式输出
bws site <name> --jq <expr> # jq 过滤表达式示例
# 知乎热榜前 10
bws site zhihu/hot 10
# 小红书搜索,只取标题
bws site xiaohongshu/search "美食" --jq '.notes[].title'
# B站热门视频 JSON
bws site bilibili/popular --json
# GitHub 仓库信息
bws site github/repo facebook/react登录态
需要登录的网站,先在 OpenClaw 浏览器中登录:
openclaw browser open https://xiaohongshu.com自定义 Adapter
将 adapter 放到 ~/.bws/sites/ 目录:
/* @meta
{
"name": "mysite/search",
"description": "搜索我的网站",
"domain": "mysite.com",
"args": { "query": { "required": true, "description": "搜索关键词" } },
"example": "bws site mysite/search 关键词"
}
*/
async function(args) {
const results = document.querySelectorAll('.result');
return Array.from(results).map(el => ({
title: el.querySelector('.title').textContent,
url: el.querySelector('a').href
}));
}环境要求
- Node.js >= 18
- OpenClaw 环境
License
MIT
