Pry Templates ๐ก Beta
Templates are reusable extraction blueprints: selectors + post-processing for a site class (news articles, product pages, forum threads).
# templates/news-article.yaml
name: news-article
version: 3
extract:
title: "h1::text"
body: "article::html"
author: "[rel=author]::text"
published: "time[datetime]::attr(datetime)"
post:
body: markdown
strip: [nav, aside, .ads]
Using templatesโ
curl -X POST :8080/v1/scrape \
-d '{"url":"https://news.example.com/story","template":"news-article"}'
Built-in templatesโ
| Template | Targets | Status |
|---|---|---|
news-article | Editorial pages | ๐ข |
product-page | E-commerce PDPs | ๐ก |
thread | Forum/social threads | ๐ก |
Contribute templates via PR โ each needs 3+ fixture-tested target domains.