Get up and running with web scraping in under 5 minutes.

Setup

Install packages:

pip install browserbase playwright agno

Set environment variables:

export BROWSERBASE_API_KEY=your_api_key_here
export BROWSERBASE_PROJECT_ID=your_project_id_here

To get env variables, go over the Dashboard’s Settings tab:

Then copy your API Key directly from the input and set the BROWSERBASE_API_KEY and BROWSERBASE_PROJECT_IDenvironment variable.

Basic Example

from agno.agent import Agent
from agno.tools.browserbase import BrowserbaseTools

# Create scraping agent  
agent = Agent(
    name="Web Scraper",
    tools=[BrowserbaseTools()],
    instructions=[
        "Extract content clearly and format nicely",
        "Always close sessions when done"
    ],
    markdown=True,
)

# Scrape quotes
response = agent.run("""
    Go to https://quotes.toscrape.com and:
    1. Get the first 3 quotes with authors
    2. Navigate to page 2  
    3. Get 2 more quotes from page 2
""")

print(response.content)

Essential Functions

FunctionPurposeUsage
navigate_toGo to URL”Navigate to https://example.com
get_page_contentExtract HTML”Get the page content”
screenshotTake screenshot”Take screenshot, save as ‘page.png‘“
close_sessionEnd session”Close the current session”