webforai
Version:
A library that provides a web interface for AI
23 lines (22 loc) • 832 B
TypeScript
import { type Browser } from "playwright-core";
export type LoadHtmlOptions = {
browser?: Browser;
timeout?: number;
waitUntil?: "load" | "domcontentloaded" | "networkidle";
superBypassMode?: boolean;
};
/**
* Useful function for load the HTML of a URL using Playwright.
* **Not recommended** for use in production environments.
* @param url - The URL to load.
* @param context - The Playwright browser context to use. If not provided, a new browser context will be created and closed after loading the URL.
* @returns The HTML content of the URL.
* @example
* ```ts
* import { loadHtml } from "webforai/loaders/playwright";
*
* const html = await loadHtml("https://example.com");
* console.log(html);
* ```
*/
export declare const loadHtml: (url: string, options?: LoadHtmlOptions) => Promise<string>;