We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/dsouza-anush/browser-use-heroku'
If you have feedback or need assistance with the MCP directory API, please join our Discord server
01_basic_search.py•906 B
"""
Getting Started Example 1: Basic Search
This example demonstrates the most basic browser-use functionality:
- Navigate to a website
- Perform a search
- Get results
Perfect for first-time users to understand how browser-use works.
"""
import asyncio
import os
import sys
# Add the parent directory to the path so we can import browser_use
sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
from dotenv import load_dotenv
load_dotenv()
from browser_use import Agent
from browser_use.llm.openai.chat import ChatOpenAI
async def main():
# Initialize the model
llm = ChatOpenAI(model='gpt-4.1-mini')
# Define a simple search task
task = "Search Google for 'what is browser automation' and tell me the top 3 results"
# Create and run the agent
agent = Agent(task=task, llm=llm)
await agent.run()
if __name__ == '__main__':
asyncio.run(main())