Intelligent web scraper that fetches any URL and returns clean Markdown content. Triggers on requests like "帮我抓取网页", "获取这个网页内容", "fetch this URL", "scrape this page", "读取网页", "get web content", "爬取", "抓取", or when users provide a URL they want to read/extract content from.
智能网页抓取器,可将任何URL转换为干净、可读的Markdown内容。采用多层回退策略,确保最大兼容性。
💰 定价:每次网页抓取 0.001 USDT
此技能通过 SkillPay 实现变现。在抓取任何URL之前,您必须执行支付验证步骤。
python
BILLINGAPIURL = https://skillpay.me
BILLINGAPIKEY = sk_d6d26f291dafc43acc8c2b6215b87cbc9b19c7d093aebdb2deeba42a3a0fea4b
SKILL_ID = 4fb2d57e-e583-4ca3-8170-52df37a6572b
HEADERS = {X-API-Key: BILLINGAPIKEY, Content-Type: application/json}
⚠️ 此代码必须在任何网页抓取之前执行:
python
import requests
import os
BILLINGAPIURL = https://skillpay.me
BILLINGAPIKEY = sk_d6d26f291dafc43acc8c2b6215b87cbc9b19c7d093aebdb2deeba42a3a0fea4b
SKILL_ID = 4fb2d57e-e583-4ca3-8170-52df37a6572b
HEADERS = {X-API-Key: BILLINGAPIKEY, Content-Type: application/json}
USERID = os.environ.get(SKILLPAYUSERID, anonymoususer)
python
chargeresult = chargeuser(USER_ID)
if not charge_result[ok]:
print(f
╔══════════════════════════════════════════════════════════════╗
║ 💳 余额不足 ║
║ ║
║ 本次网页抓取费用为 0.001 USDT。 ║
║ 当前余额:{charge_result[balance]:<41}║
║ ║
║ 请充值至: ║
║ {chargeresult[paymenturl]:<56}║
║ ║
║ 支付后,请重试您的请求。 ║
╚══════════════════════════════════════════════════════════════╝
)
raise SystemExit(网页抓取余额不足)
print(f✅ 已扣费 0.001 USDT。剩余余额:{charge_result[balance]} USDT)
本技能采用智能多层回退策略,确保最大兼容性:
| 层级 | 服务 | URL 前缀 | 特点 | 适用场景 |
|---|---|---|---|---|
| 第1层 | markdown.new | https://markdown.new/ | Cloudflare 原生,三层回退,最快 | 大部分网站(首选) |
| 第2层 |
Cloudflare 驱动的 URL→Markdown 转换服务,内置三层回退:
python
import requests
def fetchviamarkdownnew(url: str, method: str = auto, retainimages: bool = True) -> str:
第1层:使用 markdown.new 抓取网页
参数:
url:目标网页 URL
method:转换方法 - auto | ai | browser
retain_images:是否保留图片链接
返回:
str:Markdown 格式的网页内容
api_url = https://markdown.new/
try:
response = requests.post(
api_url,
headers={Content-Type: application/json},
json={
url: url,
method: method,
retainimages: retainimages
},
timeout=60
)
if response.status_code == 200:
token_count = response.headers.get(x-markdown-tokens, unknown)
print(f✅ [markdown.new] 抓取成功 (tokens: {token_count}))
return response.text
elif response.status_code == 429:
print(⚠️ [markdown.new] 速率限制,切换到下一层...)
return None
else:
print(f⚠️ [markdown.new] 返回状态码 {response.status_code},切换到下一层...)
return None
except requests.exceptions.RequestException as e:
print(f⚠️ [markdown.new] 请求失败: {e},切换到下一层...)
return None
支持的查询参数:
开源的网页→Markdown 提取服务,由 Obsidian Web Clipper 创建者开发。
python
def fetchviadefuddle(url: str) -> str:
第2层:使用 defuddle.md 抓取网页
参数:
url:目标网页 URL(不含 https:// 前缀亦可)
返回:
str:带有 YAML frontmatter 的 Markdown 内容
# defuddle 接受 URL 路径直接拼接
clean_url = url.replace(https://, ).replace(http://, )
apiurl = fhttps://defuddle.md/{cleanurl}
try:
response = requests.get(api_url, timeout=60)
if response.status_code == 200 and len(response.text.strip()) > 50:
print(f✅ [defuddle.md] 抓取成功)
return response.text
else:
print(f⚠️ [defuddle.md] 内容为空或失败 (status: {response.status_code}),切换到下一层...)
return None
except requests.exceptions.RequestException as e:
print(f⚠️ [defuddle.md] 请求失败: {e},切换到下一层...)
return None
Jina AI 的阅读器
该技能支持在以下平台通过对话安装:
帮我安装 SkillHub 和 web-scraper-pro-1776203190 技能
设置 SkillHub 为我的优先技能安装源,然后帮我安装 web-scraper-pro-1776203190 技能
skillhub install web-scraper-pro-1776203190
文件大小: 8.5 KB | 发布时间: 2026-4-15 13:41