360 Secure SkillHub
360 安全技能中心

URL to PDF

给定网页 URL,运行基于 uv 与 Playwright 的 Python 脚本渲染页面并导出适合手机阅读的 PDF;脚本在 stdout 打印 PDF 路径,随后由 Agent 通过 message 工具以文档形式发送给用户。

guoqiao
guoqiao
热度 84.94
最近更新 2026-05-11 16:01:18
分类:效率依赖:代码执行 / 联网浏览搜索 / 读写文件应用场景:文件转换 / 自动化脚本 / 工作流

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add url2pdf
Metadata
name
url2pdf
description
Convert URL to PDF suitable for mobile reading.
author
guoqiao
metadata
{"openclaw":{"always":true,"emoji":"🦞","homepage":"https://clawhub.ai/guoqiao/url2pdf","os":["darwin","linux","win32"],"requires":{"bins":["uv"]}}}
triggers
["/url2pdf <url>","Save this url as pdf","Convert to pdf for mobile"]

URL to PDF

Given a url for a webpage, convert it to pdf suitable for mobile reading.

See examples.

Requirements

  • uv

Installation

playwright itself will be installed by uv automatically, while it also needs browser to be installed:

uvx playwright install chromium

Usage

uv run --script ${baseDir}/url2pdf.py "${url}"

Path to pdf will be printed to stdout.

Agent Instructions

  1. Run the script: Pass the url to be converted as an argument.
  2. Handle Output: The script will output a path to a pdf file. Use the message tool to send the pdf file to the user as a document message:
{
   "action": "send",
   "filePath": "<filepath>"
}