Browserbase Loader
Description
Browserbase is a developer platform to reliably run, manage, and monitor headless browsers.
Power your AI data retrievals with:
- Serverless Infrastructure providing reliable browsers to extract data from complex UIs
- Stealth Mode with included fingerprinting tactics and automatic captcha solving
- Session Debugger to inspect your Browser Session with networks timeline and logs
- Live Debug to quickly debug your automation
Installation
- Get an API key and Project ID from browserbase.com and set it in environment variables (
BROWSERBASE_API_KEY
,BROWSERBASE_PROJECT_ID
). - Install the Browserbase SDK:
- npm
- Yarn
- pnpm
npm i @langchain/community @langchain/core @browserbasehq/sdk
yarn add @langchain/community @langchain/core @browserbasehq/sdk
pnpm add @langchain/community @langchain/core @browserbasehq/sdk
Example
Utilize the BrowserbaseLoader
as follows to allow your agent to load websites:
import { BrowserbaseLoader } from "@langchain/community/document_loaders/web/browserbase";
const loader = new BrowserbaseLoader(["https://example.com"], {
textContent: true,
});
const docs = await loader.load();
API Reference:
- BrowserbaseLoader from
@langchain/community/document_loaders/web/browserbase
Arguments
urls
: Required. List of URLs to load.
Options
textContent
Retrieve only text content. Default isfalse
.sessionId
Optional. Provide an existing Session ID.proxy
Optional. Enable/Disable Proxies.