A lightweight web scraping API powered by Deno that extracts data from any website using CSS selectors
Extracts text content from HTML elements using CSS selectors.
| Parameter | Description | Required |
|---|---|---|
from |
URL to fetch content from | Yes |
extract |
JSON object mapping names to selectors | Yes |
Extracts HTML markup or returns raw HTML from a page.
| Parameter | Description | Required |
|---|---|---|
from |
URL to fetch content from | Yes |
extract |
JSON object mapping names to selectors | No |
Returns the raw HTML from the target URL (acts as a simple proxy).
| Parameter | Description | Required |
|---|---|---|
from |
URL to fetch content from | Yes |
URL: https://en.wikipedia.org/wiki/Deno_(software)
const extract = {
"title": "h1",
"title_link": "h1 a@href", // Extract link using @href
"intro": ".mw-parser-output > p"
};
URL: https://github.com/denoland/deno
const extract = {
"repoName": "h1 strong a",
"description": "p.f4",
"stars": "#repo-stars-counter-star"
};
URL: https://dev.to
const extract = {
"headlines": "h2.crayons-story__title a",
"authors": ".crayons-story__secondary a"
};
URL: https://news.ycombinator.com
const extract = {
"headlines": ".titleline > a",
"scores": ".score"
};
URL: https://old.reddit.com/r/programming
const extract = {
"titles": ".title > a",
"domain": ".domain"
};
URL: https://en.wikipedia.org/wiki/Web_scraping
Get the actual HTML markup instead of text:
const extract = {
"infobox": ".infobox",
"firstPara": ".mw-parser-output > p"
};
URL: https://bold.dk
Extract Danish news headlines with clickable links (naming convention):
const extract = {
"overskrifter": ".article-headline",
"overskrifter_link": ".thumb.article_list_item@href", // _link suffix creates clickable links
"kategorier": ".ArticleListItem__tag"
};
If a selector matches one element, returns a string:
{
"title": "Deno - A modern runtime for JavaScript and TypeScript"
}
If a selector matches multiple elements, returns an array:
{
"headlines": [
"First headline",
"Second headline",
"Third headline"
]
}
If a selector matches no elements, returns an empty string:
{
"missing": ""
}