import { extractMarkdown } from "@intuned/browser";import { BrowserContext, Page } from "playwright";interface Params {}export default async function handler( params: Params, page: Page, context: BrowserContext) { await page.goto("https://books.toscrape.com/"); const headerLocator = page.locator("h1").first(); // First title on the page const markdown = await extractMarkdown({ source: headerLocator }); // Extract markdown from the first title console.log(markdown); return markdown;}
The source of the HTML content. When a Page is provided, extracts from the entire page. When a Locator is provided, extracts from that specific element.