Browserbase Loader
Description
Browserbase is a serverless platform for running headless browsers, it offers advanced debugging, session recordings, stealth mode, integrated proxies and captcha solving.
Installation
- Get an API key from browserbase.com and set it in environment variables (
BROWSERBASE_API_KEY
). - Install the Browserbase SDK:
- npm
- Yarn
- pnpm
npm i @browserbasehq/sdk
yarn add @browserbasehq/sdk
pnpm add @browserbasehq/sdk
Example
Utilize the BrowserbaseLoader
as follows to allow your agent to load websites:
import { BrowserbaseLoader } from "langchain/document_loaders/web/browserbase";
const loader = new BrowserbaseLoader(["https://example.com"], {
textContent: true,
});
const docs = await loader.load();
API Reference:
- BrowserbaseLoader from
langchain/document_loaders/web/browserbase
Arguments
urls
: Required. List of URLs to load.
Options
api_key
: Optional. Specifies Browserbase API key. Defaults is theBROWSERBASE_API_KEY
environment variable.text_content
: Optional. Load pages as readable text. Default isFalse
.