• Import from "@langchain/community/document_loaders/web/pplaywrightdf" instead. This entrypoint will be removed in 0.3.0.

Class representing a document loader for scraping web pages using Playwright. Extends the BaseDocumentLoader class and implements the DocumentLoader interface.

Hierarchy (view full)

Implements

Constructors

Properties

Methods

Constructors

Properties

options: undefined | PlaywrightWebBaseLoaderOptions
webPath: string

Methods

  • 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.

  • Method that calls the _scrape method to perform the scraping of the web page specified by the webPath property. Returns a Promise that resolves to the scraped HTML content of the web page.

    Returns Promise<string>

    Promise that resolves to the scraped HTML content of the web page.

  • Static method that imports the necessary Playwright modules. Returns a Promise that resolves to an object containing the imported modules.

    Returns Promise<{
        chromium: BrowserType<{}>;
    }>

    Promise that resolves to an object containing the imported modules.