Documentation Index
Fetch the complete documentation index at: https://docs.browserbase.com/llms.txt
Use this file to discover all available pages before exploring further.
Install the Browserbase SDK, Playwright, and Langchain Community
# If you haven't installed pipx (MacOS)
brew install pipx
# Install Dependencies
pipx install browserbase playwright langchain_community --include-deps
Load documents or images
Load documentsfrom langchain_community.document_loaders import BrowserbaseLoader
import os
from dotenv import load_dotenv
load_dotenv()
BROWSERBASE_API_KEY = os.getenv("BROWSERBASE_API_KEY")
loader = BrowserbaseLoader(
api_key=BROWSERBASE_API_KEY,
urls=[
# load multiple pages
"https://www.espn.com",
"https://lilianweng.github.io/posts/2023-06-23-agent/"
],
text_content=True,
)
documents = loader.load()
print(documents)
Loader options
urls Required. A list of URLs to fetch.
text_content Retrieve only text content. Default is False.
api_key Browserbase API key. Default is BROWSERBASE_API_KEY env variable.
session_id Optional. Provide an existing Session ID.
proxy Optional. Enable/Disable Proxies.