mrscraper
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseMrScraper CLI
MrScraper CLI
Use this skill for setup, authentication, command selection, shared output
handling, account status, and troubleshooting. Load the focused skills for
page retrieval and Google search.
The CLI has three data commands:
| Command | Purpose |
|---|---|
| Retrieve a known page as HTML, Markdown, a screenshot, or a combination. |
| Search Google from query text or a Google search URL. |
| Show the account's subscription, token usage, and limits. |
使用此 skill 进行设置、身份验证、命令选择、通用输出处理、账户状态检查和故障排除。页面检索和 Google 搜索请加载对应的专项 skill。
CLI 提供三个数据命令:
| 命令 | 用途 |
|---|---|
| 以 HTML、Markdown、屏幕截图或其组合形式检索已知页面。 |
| 根据查询文本或 Google 搜索 URL 搜索 Google。 |
| 显示账户的订阅信息、token 用量和限额。 |
Step 1 — Verify or Install MrScraper
步骤 1 — 验证或安装 MrScraper
Check whether the CLI is available:
bash
command -v mrscraper && mrscraper --versionWhen an agent performs first-time setup, install the CLI and all three skills
without starting an interactive authentication step:
bash
npx -y @mrscraper/cli@latest init --all --yes --skip-authThe flags have separate purposes:
- approves npm package execution.
npx -y - keeps bootstrap non-interactive.
--yes - leaves login for the next step.
--skip-auth - installs skills for supported harnesses detected on the machine.
--all
检查 CLI 是否可用:
bash
command -v mrscraper && mrscraper --version当 Agent 首次进行设置时,应安装 CLI 和全部三个 skill,但不启动交互式身份验证步骤:
bash
npx -y @mrscraper/cli@latest init --all --yes --skip-auth各个 flag 的用途各不相同:
- 批准执行 npm 包。
npx -y - 使 bootstrap 保持非交互式。
--yes - 将登录留到下一步处理。
--skip-auth - 为机器上检测到的所有受支持 harness 安装 skill。
--all
Bootstrap parameters
Bootstrap 参数
| Parameter | Default | Use |
|---|---|---|
| omitted | Save a supplied API key during bootstrap. Agents should use |
| detected harnesses | Install skills for every supported harness found on the machine. |
| omitted | Install skills for one supported harness. |
| off | Keep bootstrap non-interactive. |
| off | Skip global CLI installation. |
| off | Leave authentication for a separate login step. |
| off | Skip skill-pack installation. |
| off | Print planned actions without changing the system. |
To target one harness, use its MrScraper ID:
| Harness | ID |
|---|---|
| Claude Code | |
| Cursor | |
| Codex | |
| Grok Build | |
| Hermes Agent | |
| OpenCode | |
| OpenClaw | |
| Pi | |
| Oh My Pi | |
bash
npx -y @mrscraper/cli@latest init --agent codex --yes --skip-authRefresh the skill pack without reinstalling the CLI:
bash
mrscraper setup skills
mrscraper setup skills --agent codex
mrscraper setup skills --dry-runsetup skills--all--agent <id>--dry-runThe bootstrap installs the CLI and skills. MCP is available separately at
with the same capabilities as the ,
, and tools.
https://mcp.mrscraper.com/mcpscraperAPIwebSearchstatus| 参数 | 默认值 | 用途 |
|---|---|---|
| 省略 | 在 bootstrap 期间保存提供的 API key。Agent 应使用 |
| 检测到的 harness | 为机器上找到的每个受支持 harness 安装 skill。 |
| 省略 | 为一个受支持的 harness 安装 skill。 |
| 关闭 | 使 bootstrap 保持非交互式。 |
| 关闭 | 跳过全局 CLI 安装。 |
| 关闭 | 将身份验证留待单独的登录步骤。 |
| 关闭 | 跳过 skill 包安装。 |
| 关闭 | 打印计划执行的操作,而不更改系统。 |
若要指定一个 harness,请使用其 MrScraper ID:
| Harness | ID |
|---|---|
| Claude Code | |
| Cursor | |
| Codex | |
| Grok Build | |
| Hermes Agent | |
| OpenCode | |
| OpenClaw | |
| Pi | |
| Oh My Pi | |
bash
npx -y @mrscraper/cli@latest init --agent codex --yes --skip-auth无需重新安装 CLI 即可刷新 skill 包:
bash
mrscraper setup skills
mrscraper setup skills --agent codex
mrscraper setup skills --dry-runsetup skills--all--agent <id>--dry-runBootstrap 会安装 CLI 和 skill。MCP 可单独通过 使用,其功能与 、 和 工具相同。
https://mcp.mrscraper.com/mcpscraperAPIwebSearchstatusStep 2 — Authenticate
步骤 2 — 身份验证
Inspect the available credential:
bash
mrscraper auth status --jsonA configured credential reports . This command
reads local configuration only.
credential_configured: trueA result means the CLI is not authenticated. On
a local interactive machine, start browser login so the CLI can be used right
away:
credential_configured: falsebash
mrscraper loginKeep the command running while the user approves the browser request. Browser
login waits up to three minutes and stores the resulting API key under
, or under when configured.
~/.mrscraper/auth.jsonMRSCRAPER_HOMEFor CI, containers, or headless automation, use . A human
can also store a key outside the agent conversation:
MRSCRAPER_API_KEYbash
mrscraper login --api-key "<key>"After credentials are configured, verify end-to-end access with the account
check, which does not retrieve a page:
bash
mrscraper status --jsonTreat a successful command as confirmation that the CLI can authenticate and
reach the service. If it fails, report the error and do not claim setup is
complete.
检查现有凭据:
bash
mrscraper auth status --json已配置凭据时会报告 。此命令仅读取本地配置。
credential_configured: true如果结果为 ,则表示 CLI 尚未通过身份验证。在本地交互式机器上,启动浏览器登录,以便立即使用 CLI:
credential_configured: falsebash
mrscraper login用户批准浏览器请求时,应保持该命令运行。浏览器登录最多等待三分钟,并将生成的 API key 存储在 下;如果配置了 ,则存储在该目录下。
~/.mrscraper/auth.jsonMRSCRAPER_HOME对于 CI、容器或无头自动化,请使用 。人工用户也可以在 Agent 对话之外存储 API key:
MRSCRAPER_API_KEYbash
mrscraper login --api-key "<key>"配置凭据后,使用账户检查验证端到端访问能力;此操作不会检索页面:
bash
mrscraper status --json命令成功即表示 CLI 能够完成身份验证并访问服务。如果失败,应报告错误,且不得声称设置已完成。
Login parameters
Login 参数
| Parameter | Default | Use |
|---|---|---|
| omitted | Save an API key instead of opening browser login. |
| omitted | Deprecated alias for login's |
| off | Prompt an interactive human for an API key. |
| off | Print the browser URL while keeping the callback listener active. |
| | Set the browser callback wait time. |
Credential precedence for API commands is:
- Command option ;
--token - Environment variable ;
MRSCRAPER_API_KEY - Environment variable ; and
MRSCRAPER_API_TOKEN - Saved credential .
~/.mrscraper/auth.json
Never ask the user to paste an API key into chat, print credentials, or commit
credential files. Use to remove saved local credentials.
mrscraper logout| 参数 | 默认值 | 用途 |
|---|---|---|
| 省略 | 保存 API key,而不是打开浏览器登录。 |
| 省略 | Login 的 |
| 关闭 | 提示交互式用户输入 API key。 |
| 关闭 | 打印浏览器 URL,同时保持回调监听器处于活动状态。 |
| | 设置浏览器回调等待时间。 |
API 命令的凭据优先级为:
- 命令选项 ;
--token - 环境变量 ;
MRSCRAPER_API_KEY - 环境变量 ;以及
MRSCRAPER_API_TOKEN - 已保存的凭据 。
~/.mrscraper/auth.json
绝不要要求用户将 API key 粘贴到聊天中、打印凭据或提交凭据文件。使用 删除已保存的本地凭据。
mrscraper logoutStep 3 — Route the Request
步骤 3 — 路由请求
| User outcome | Command or skill |
|---|---|
| Acquire and preserve a known public page for any downstream task | mrscraper-fetch with |
| Discover relevant pages from a Google query | mrscraper-serp with |
| Check the plan, token usage, or remaining tokens | |
| 用户目标 | 命令或 skill |
|---|---|
| 获取并保留一个已知的公共页面,供任何下游任务使用 | mrscraper-fetch 与 |
| 从 Google 查询中发现相关页面 | mrscraper-serp 与 |
| 检查套餐、token 用量或剩余 token 数 | |
Retrieve first, extract locally
先检索,再在本地提取
The CLI returns raw page content. Produce summaries, tables, JSON, and other
structured output from that content with local analysis or extraction code.
The raw response preserves details for later questions, validation, and
changes to the requested schema.
For many pages that share a layout:
- Retrieve representative pages and inspect their content;
- Understand the shared structure and required fields;
- Define a stable output schema and one local extraction implementation;
- Retrieve the remaining pages, in parallel when safe and proportional; and
- Run the same extractor across all saved responses.
Request Markdown with when readable text is enough, and HTML when
the extractor needs the page structure.
--markdownFor discovery-first work, run , select the relevant URLs, and
retrieve the pages whose content will inform the answer.
web-searchThe CLI does not create AI scrapers, rerun saved scrapers, or list stored
results. Use the MrScraper dashboard at https://app.mrscraper.com for those.
CLI 返回原始页面内容。使用本地分析或提取代码,从该内容生成摘要、表格、JSON 和其他结构化输出。
原始响应会保留相关细节,以便后续提问、验证以及按要求调整输出 schema。
对于许多采用相同布局的页面:
- 检索具有代表性的页面并检查其内容;
- 理解共享结构和所需字段;
- 定义稳定的输出 schema 和一套本地提取实现;
- 在安全且规模适当的情况下并行检索其余页面;以及
- 对所有已保存的响应运行同一个提取器。
如果可读文本已经足够,请使用 请求 Markdown;如果提取器需要页面结构,请请求 HTML。
--markdown对于以发现为目标的工作,请先运行 ,选择相关 URL,再检索其内容可用于回答问题的页面。
web-searchCLI 不会创建 AI scraper、重新运行已保存的 scraper 或列出已存储的结果。请使用 MrScraper 仪表板 https://app.mrscraper.com 完成这些操作。
Step 4 — Handle Output and Artifacts
步骤 4 — 处理输出和产物
Data commands print JSON to stdout:
json
{
"status_code": 200,
"data": {},
"headers": {}
}API failures exit nonzero and add . Progress and diagnostics use
stderr. Request explicitly because an interactive terminal
otherwise displays the account dashboard.
errorstatus --jsonSave substantial artifacts under the current project's
folder:
./.mrscraper/bash
mkdir -p ./.mrscraper
mrscraper scraper-api "https://www.scrapethissite.com/pages/simple/" \
> ./.mrscraper/countries-page.json
mrscraper web-search "country population data" > ./.mrscraper/search.jsonThe project artifact folder is separate from the credential
folder . Keep project artifacts out of version control unless
the user asks to commit them.
./.mrscraper/~/.mrscraper/数据命令会将 JSON 打印到 stdout:
json
{
"status_code": 200,
"data": {},
"headers": {}
}API 失败时以非零状态退出,并添加 。进度和诊断信息使用 stderr。请显式请求 ,否则在交互式终端中会显示账户仪表板。
errorstatus --json将体积较大的产物保存在当前项目的 文件夹下:
./.mrscraper/bash
mkdir -p ./.mrscraper
mrscraper scraper-api "https://www.scrapethissite.com/pages/simple/" \
> ./.mrscraper/countries-page.json
mrscraper web-search "country population data" > ./.mrscraper/search.json项目产物文件夹 与凭据文件夹 相互独立。除非用户要求提交,否则不要将项目产物加入版本控制。
./.mrscraper/~/.mrscraper/Step 5 — Review Account Usage
步骤 5 — 查看账户使用情况
Request machine-readable account status:
bash
mrscraper status --jsonThe response summarizes the subscription status, token limit, token usage,
remaining tokens, usage percentage, rate limit, auto-renewal, renewal date, and
the account's name, email, and verification state. It never includes the API
key.
请求机器可读的账户状态:
bash
mrscraper status --json响应会汇总订阅状态、token 限额、token 用量、剩余 token、使用百分比、速率限制、自动续费、续费日期,以及账户名称、邮箱和验证状态。其中绝不包含 API key。
Status parameters
Status 参数
| Parameter | Default | Use |
|---|---|---|
| automatic when piped | Print JSON. Agents should include it. |
| automatic in a terminal | Print the account dashboard. |
| off | Disable dashboard color. |
| configured credential | Override authentication. |
Check remaining tokens before a large batch of page retrievals.
| 参数 | 默认值 | 用途 |
|---|---|---|
| 通过管道传输时自动启用 | 打印 JSON。Agent 应包含此参数。 |
| 在终端中自动启用 | 打印账户仪表板。 |
| 关闭 | 禁用仪表板着色。 |
| 已配置的凭据 | 覆盖身份验证设置。 |
批量检索大量页面前,请检查剩余 token 数。
Step 6 — Troubleshoot
步骤 6 — 故障排除
- Unauthorized or 401 — run in a local interactive session or verify
mrscraper loginin automation.MRSCRAPER_API_KEY - CLI missing — run the agent-safe command from Step 1.
npx ... init - Skills missing — run , then target the current harness with
mrscraper setup skills --dry-run.--agent <id> - Page blocked, incomplete, or missing dynamic content — load mrscraper-fetch and retry with page-loading options appropriate to the target.
- Structured output is incomplete — inspect the saved raw content and improve the local extraction logic.
- Search results are weak — load mrscraper-serp and refine the query, locale, or page.
- Unknown option or command — run . The
mrscraper <command> --help,fetch,scrape,serp,rerun, andresultscommands were replaced byresult,scraper-api, andweb-search.status
- 未授权或 401 — 在本地交互式会话中运行 ,或在自动化环境中验证
mrscraper login。MRSCRAPER_API_KEY - 缺少 CLI — 运行步骤 1 中对 Agent 安全的 命令。
npx ... init - 缺少 Skill — 运行 ,然后使用
mrscraper setup skills --dry-run定向当前 harness。--agent <id> - 页面被阻止、内容不完整或缺少动态内容 — 加载 mrscraper-fetch,并使用适合目标页面的页面加载选项重试。
- 结构化输出不完整 — 检查已保存的原始内容,并改进本地提取逻辑。
- 搜索结果不理想 — 加载 mrscraper-serp,并优化查询、区域设置或页面。
- 未知选项或命令 — 运行 。
mrscraper <command> --help、fetch、scrape、serp、rerun和results命令已分别被result、scraper-api和web-search取代。status
Limits
限制
Use another tool for:
- Clicking controls, completing forms, or authenticated browser sessions;
- Parsing local PDFs, documents, spreadsheets, or other files;
- Recurring monitoring, notifications, or scheduling.
Explain the boundary and continue with any supported portion of the task.
以下情况请使用其他工具:
- 点击控件、填写表单或使用需要身份验证的浏览器会话;
- 解析本地 PDF、文档、电子表格或其他文件;
- 定期监控、通知或调度。
请说明这些边界,并继续完成任务中受支持的部分。