Browser-use Browser AI Agent

πŸ“Ί refer link :https://youtu.be/15LCeh46sMs?si=FZgEk4C-NsBmKfD4

Github: https://github.com/browser-use/browser-use

Setup

  • With pip (Python>=3.11):

pip install browser-use
  • Install Playwright:

playwright install chromium
  • Spin up your agent:

from langchain_openai import ChatOpenAI
from browser_use import Agent
import asyncio
from dotenv import load_dotenv
load_dotenv()

async def main():
    agent = Agent(
        task="Compare the price of gpt-4o and DeepSeek-V3",
        llm=ChatOpenAI(model="gpt-4o"),
    )
    await agent.run()

asyncio.run(main())
  • Add your API keys for the provider you want to use to your .env file:

OPENAI_API_KEY=
ANTHROPIC_API_KEY=
AZURE_ENDPOINT=
AZURE_OPENAI_API_KEY=
GEMINI_API_KEY=
DEEPSEEK_API_KEY=

Last updated