1 2 3 4 5 6 7 8 9 10 11 12 13 14
import { parse } from "flyscrape"; export const options = { url: "https://esbuild.github.io/plugins/", } export default function({ html }) { const doc = parse(html); return { headline: doc('h1').text().trim(), body: doc('main > p:nth-of-type(1)').text().trim(), }; }