返回顶部
s

scraper文档抓取工具

Scrape documents from Notion, DocSend, PDFs, and other sources into local PDF files. Use when the user needs to download, archive, or convert web documents to PDF format. Supports authentication flows for protected documents and session persistence via profiles. Returns local file paths to downloaded PDFs.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 0.0.1
安全检测
已通过
2,042
下载量
免费
免费
2
收藏
概述
安装方式
版本历史

scraper

docs-scraper

使用浏览器自动化从各种来源抓取文档并保存为本地PDF文件的CLI工具。

安装

bash
npm install -g docs-scraper

快速开始

将任意文档URL抓取为PDF:

bash
docs-scraper scrape https://example.com/document

返回本地路径:~/.docs-scraper/output/1706123456-abc123.pdf

基础抓取

使用守护进程抓取(推荐,保持浏览器预热):
bash
docs-scraper scrape

使用命名配置文件抓取(用于需要认证的站点):
bash
docs-scraper scrape -p

使用预填数据抓取(例如DocSend的邮箱):
bash
docs-scraper scrape -D email=user@example.com

直接模式(单次运行,不使用守护进程):
bash
docs-scraper scrape --no-daemon

认证工作流程

当文档需要认证(登录、邮箱验证、验证码)时:

  1. 1. 首次抓取返回一个任务ID:
bash docs-scraper scrape https://docsend.com/view/xxx # 输出:抓取被阻止 # 任务ID:abc123
  1. 2. 使用数据重试:
bash docs-scraper update abc123 -D email=user@example.com # 或带密码 docs-scraper update abc123 -D email=user@example.com -D password=1234

配置文件管理

配置文件存储认证站点的会话Cookie。

bash
docs-scraper profiles list # 列出已保存的配置文件
docs-scraper profiles clear # 清除所有配置文件
docs-scraper scrape -p myprofile # 使用配置文件

守护进程管理

守护进程保持浏览器实例预热,以实现更快的抓取。

bash
docs-scraper daemon status # 检查状态
docs-scraper daemon start # 手动启动
docs-scraper daemon stop # 停止守护进程

注意:运行抓取命令时守护进程会自动启动。

清理

PDF文件存储在~/.docs-scraper/output/目录中。守护进程会自动清理超过1小时的文件。

手动清理:
bash
docs-scraper cleanup # 删除所有PDF文件
docs-scraper cleanup --older-than 1h # 删除超过1小时的PDF文件

任务管理

bash
docs-scraper jobs list # 列出等待认证的阻塞任务

支持的来源

  • - 直接PDF链接 - 直接下载PDF
  • Notion页面 - 将Notion页面导出为PDF
  • DocSend文档 - 处理DocSend查看器
  • LLM回退 - 对其他网页使用Claude API

抓取器参考

每个抓取器接受特定的-D数据字段。根据URL类型使用相应的字段。

DirectPdfScraper

处理: 以.pdf结尾的URL

数据字段: 无(直接下载)

示例:
bash
docs-scraper scrape https://example.com/document.pdf



DocsendScraper

处理: docsend.com/view/、docsend.com/v/以及子域名(例如org-a.docsend.com)

URL模式:

  • - 文档:https://docsend.com/view/{id} 或 https://docsend.com/v/{id}
  • 文件夹:https://docsend.com/view/s/{id}
  • 子域名:https://{subdomain}.docsend.com/view/{id}

数据字段:

字段类型描述
email邮箱用于文档访问的邮箱地址
password
密码 | 受保护文档的密码/验证码 |
| name | 文本 | 您的姓名(NDA限制文档需要) |

示例:
bash

预填DocSend邮箱


docs-scraper scrape https://docsend.com/view/abc123 -D email=user@example.com

带密码保护

docs-scraper scrape https://docsend.com/view/abc123 -D email=user@example.com -D password=secret123

带NDA姓名要求

docs-scraper scrape https://docsend.com/view/abc123 -D email=user@example.com -D name=John Doe

重试阻塞任务

docs-scraper update abc123 -D email=user@example.com -D password=secret123

注意:

  • - DocSend可能需要邮箱、密码和姓名的任意组合
  • 文件夹会被抓取为包含文档链接的目录PDF
  • 提供姓名时,抓取器会自动勾选NDA复选框



NotionScraper

处理: notion.so/.notion.site/*

数据字段:

字段类型描述
email邮箱Notion账户邮箱
password
密码 | Notion账户密码 |

示例:
bash

公开页面(无需认证)


docs-scraper scrape https://notion.so/Public-Page-abc123

需要登录的私有页面

docs-scraper scrape https://notion.so/Private-Page-abc123 \ -D email=user@example.com -D password=mypassword

自定义域名

docs-scraper scrape https://docs.company.notion.site/Page-abc123

注意:

  • - 公开Notion页面无需认证
  • 切换块会在PDF生成前自动展开
  • 使用会话配置文件在多次抓取间保持登录状态



LlmFallbackScraper

处理: 其他抓取器未匹配的任何URL(自动回退)

数据字段: 动态 - 由Claude分析页面后确定

LLM抓取器使用Claude分析页面HTML并检测:

  • - 登录表单(动态提取字段名)
  • Cookie横幅(自动关闭)
  • 可展开内容(自动展开)
  • 验证码(报告为被阻止)
  • 付费墙(报告为被阻止)

常见动态字段:

字段类型描述
email邮箱登录邮箱(如检测到)
password
密码 | 登录密码(如检测到) |
| username | 文本 | 用户名(如登录使用用户名) |

示例:
bash

通用网页(无需认证)


docs-scraper scrape https://example.com/article

需要登录的网页

docs-scraper scrape https://members.example.com/article \ -D email=user@example.com -D password=secret

被阻止时,检查任务所需的字段

docs-scraper jobs list

然后使用抓取器检测到的字段重试

docs-scraper update abc123 -D username=myuser -D password=secret

注意:

  • - 需要ANTHROPICAPIKEY环境变量
  • 字段名从页面的实际表单字段中提取
  • 限制2次登录尝试,失败后停止
  • 验证码需要手动干预



数据字段汇总


抓取器emailpasswordname其他
DirectPdf----
DocSend
✓ | ✓ | ✓ | - |
| Notion | ✓ | ✓ | - | - |
| LLM回退 | ✓ | ✓ | - | 动态* |

*字段从页面分析中动态检测

环境设置(可选)

仅LLM回退抓取器需要:

bash
export ANTHROPICAPIKEY=your_key

可选的浏览器设置:
bash
export BROWSER_HEADLESS=true # 设为false进行调试

常见模式

归档Notion页面:
bash
docs-scraper scrape https://notion.so/My-Page-abc123

下载受保护的DocSend:
bash
docs-scraper scrape https://docsend.com/view/xxx

如果被阻止:


docs-scraper update -D email=user@example.com -D password=1234

使用配置文件批量抓取:
bash
docs-scraper scrape https://site.com/doc1 -p mysite
docs-scraper scrape https://site.com/doc2 -p mysite

输出

成功:本地文件路径(例如~/.docs-scraper/output/1706123456-abc123.pdf)
被阻止:任务ID + 所需凭证类型

故障排除

  • -

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 links-to-pdfs-1776371772 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 links-to-pdfs-1776371772 技能

通过命令行安装

skillhub install links-to-pdfs-1776371772

下载

⬇ 下载 scraper v0.0.1(免费)

文件大小: 3.2 KB | 发布时间: 2026-4-17 14:09

v0.0.1 最新 2026-4-17 14:09
Initial public release of the links-to-pdfs skill.

- Scrapes documents from Notion, DocSend, direct PDFs, and other web sources into local PDF files.
- Supports authentication workflows and session persistence via profiles for protected documents.
- Includes a command-line interface with profile and job management, daemon for faster scrapes, and automatic cleanup.
- Provides fallback to LLM-based scraping for unsupported or dynamic websites.
- Returns local file paths to downloaded PDFs.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部