Import from "@langchain/community/document_loaders/web/browserbase" instead. This entrypoint will be removed in 0.3.0. Load pre-rendered web pages using a headless browser hosted on Browserbase.

Depends on @browserbasehq/sdk package. Get your API key from https://browserbase.com

import { BrowserbaseLoader } from "langchain/document_loaders/web/browserbase";

const loader = new BrowserbaseLoader(["https://example.com"], {
apiKey: process.env.BROWSERBASE_API_KEY,
textContent: true,
});

const docs = await loader.load();

The URLs of the web pages to load.

Browserbase client options.

Hierarchy (view full)

Implements

Constructors

Properties

browserbase: Browserbase
options: BrowserbaseLoaderOptions
urls: string[]

Methods

  • Load pages from URLs.

    Returns AsyncGenerator<Document<{
        url: string;
    }>, void, unknown>

    • A generator that yields documents.
  • Parameters

    • Optionalsplitter: BaseDocumentTransformer<DocumentInterface<Record<string, any>>[], DocumentInterface<Record<string, any>>[]>

    Returns Promise<Document<Record<string, any>>[]>

    A Promise that resolves with an array of Document instances, each split according to the provided TextSplitter.

    Use this.load() and splitter.splitDocuments() individually. Loads the documents and splits them using a specified text splitter.