summaryrefslogtreecommitdiff
path: root/examples/esbuild.github.io.js
blob: 7839791da1c39345ad39c666ef8fc60c410d93c3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import { parse } from "flyscrape";

export const options = {
    url: "https://esbuild.github.io/plugins/",
    depth: 1,
    rate: 100,
    allowedDomains: [
        "esbuild.github.io", 
        "nodejs.org",
    ],
}

export default function({ html }) {
    const doc = parse(html);

    return {
        headline: doc('h1').text().trim(),
        body: doc('main > p:nth-of-type(1)').text().trim(),
    };
}