web-search

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Web Search

网页搜索

Use the bundled CLI to search through a local browser, visit results, and extract pages as clean Markdown for agent context. The persistent browser daemon reduces bot-detection failures and avoids repeated browser startup costs.
The entry point is
{baseDir}/web-search.js
, where
{baseDir}
is the absolute directory containing this
SKILL.md
. Always invoke that absolute path. Never run
./web-search.js
from the caller's project directory.
使用内置CLI通过本地浏览器进行搜索,访问搜索结果,并将页面提取为简洁的Markdown格式,供Agent使用。持久化浏览器守护进程可减少反爬虫检测失败的概率,并避免重复启动浏览器的开销。
入口文件为
{baseDir}/web-search.js
,其中
{baseDir}
是包含此
SKILL.md
文件的绝对目录。请始终调用该绝对路径,切勿从调用者的项目目录运行
./web-search.js

Setup

设置

If dependencies are missing, run
bun install
in the skill directory.
The CLI auto-detects Chromium-family browsers. Override detection with
WEB_SEARCH_BROWSER_BIN
or
--browser-bin <path>
.
如果缺少依赖项,请在技能目录中运行
bun install
CLI会自动检测Chromium系列浏览器。可通过
WEB_SEARCH_BROWSER_BIN
环境变量或
--browser-bin <路径>
参数覆盖检测结果。

Search and fetch

搜索与抓取

bash
{baseDir}/web-search.js "query"
{baseDir}/web-search.js "query" -n 10
{baseDir}/web-search.js --from <result-set-id> --fetch 1,3,5
{baseDir}/web-search.js --url https://example.com
{baseDir}/web-search.js --url https://example.com --full
Each search prints a result-set ID. Always pass that ID with
--from
when fetching numbered results; result sets expire after ten minutes. Use
--full
only when the complete page text is needed.
bash
{baseDir}/web-search.js "query"
{baseDir}/web-search.js "query" -n 10
{baseDir}/web-search.js --from <result-set-id> --fetch 1,3,5
{baseDir}/web-search.js --url https://example.com
{baseDir}/web-search.js --url https://example.com --full
每次搜索都会输出一个结果集ID。抓取指定编号的结果时,请务必通过
--from
参数传入该ID;结果集将在十分钟后过期。仅当需要完整页面文本时才使用
--full
参数。

Browser daemon

浏览器守护进程

Direct calls use a local daemon by default for a warm browser session.
bash
{baseDir}/web-search.js --daemon status
{baseDir}/web-search.js --daemon start
{baseDir}/web-search.js --daemon stop
{baseDir}/web-search.js --daemon restart
{baseDir}/web-search.js --no-daemon --url https://example.com
默认情况下,直接调用会使用本地守护进程以维持浏览器会话处于预热状态。
bash
{baseDir}/web-search.js --daemon status
{baseDir}/web-search.js --daemon start
{baseDir}/web-search.js --daemon stop
{baseDir}/web-search.js --daemon restart
{baseDir}/web-search.js --no-daemon --url https://example.com

Troubleshooting

故障排查

Treat one blocked page as a normal site-specific failure. Retry once, use another result, or try the direct URL before changing browser state.
For repeated timeouts, daemon errors, or blocks across multiple attempts:
  1. Check
    {baseDir}/web-search.js --daemon status
    .
  2. Run
    {baseDir}/web-search.js --daemon restart
    and retry.
  3. If blocks persist, inspect
    health.profileDir
    in the status output. Stop the daemon, delete only that hidden skill profile directory, then start the daemon again. This resets stale cookies and browser storage without touching the user's normal browser profile.
Never clear the profile after a single block. Profile reset is a last resort for persistent failures.
单个页面被拦截属于特定站点的正常失败情况。先重试一次,或使用其他搜索结果,或尝试直接访问URL,再考虑更改浏览器状态。
若出现多次超时、守护进程错误或多次尝试均被拦截的情况:
  1. 检查
    {baseDir}/web-search.js --daemon status
    的输出。
  2. 运行
    {baseDir}/web-search.js --daemon restart
    后重试。
  3. 若拦截问题持续存在,请查看状态输出中的
    health.profileDir
    。停止守护进程,仅删除该隐藏的技能配置文件目录,然后重新启动守护进程。这将重置过期的Cookie和浏览器存储,且不会影响用户的常规浏览器配置文件。
请勿在单次拦截后就清除配置文件。重置配置文件是解决持续故障的最后手段。

Reporting

报告要求

Use the URLs actually searched or fetched as sources. Cite those URLs when answering from web material.
请将实际搜索或抓取的URL作为来源。使用网页内容作答时,请引用这些URL。