Skip to content

browser-usevschromedp

MIT 600 30 122,292
7.9 million (month) Nov 01 2024 1.0.9(2026-11-26 23:16:49 ago)
13,387 6 - MIT
Mar 11 2022 58.1 thousand (month) v0.24.0(2026-11-18 05:04:28 ago)

Browser-use is a Python library that enables AI agents to control web browsers using natural language instructions. It connects large language models (LLMs) to browser automation, allowing you to describe what you want done in plain English instead of writing explicit selectors and interaction code.

Key features include:

  • Natural language browser control Describe tasks like "go to Amazon and find the cheapest laptop under $500" and the AI agent will navigate, interact with elements, and extract the requested information.
  • Multi-step task execution Can handle complex workflows that require multiple pages, form filling, clicking, scrolling, and waiting for dynamic content.
  • Vision support Uses screenshot analysis (multimodal LLMs) to understand page layout and find elements visually, not just through DOM inspection.
  • Multiple LLM providers Works with OpenAI, Anthropic Claude, Google Gemini, and other LLM providers.
  • Playwright backend Uses Playwright under the hood for reliable browser automation across Chrome, Firefox, and Safari.
  • Structured output Can return extracted data in structured formats defined by Pydantic models.

Browser-use represents a new paradigm in web scraping where instead of writing brittle selectors, you describe the extraction task and let the AI figure out how to navigate and extract the data. This is especially useful for scraping diverse sites with varying layouts.

ChromeDP is an open-source library for driving browsers using the Chrome DevTools Protocol (CDP) in the Go programming language. It is a high-level library that abstracts away the low-level details of interacting with the CDP and provides a simple, intuitive API for performing common browser automation tasks such as clicking elements, filling out forms, and taking screenshots.

ChromeDP also supports parallel execution of browser tasks, making it well-suited for large-scale web scraping and testing applications. It is considered as one of the most popular Go package for automation and scraping tasks.

Highlights


ai-powerednatural-languageasync

Example Use


from browser_use import Agent
from langchain_openai import ChatOpenAI
import asyncio

async def main():
    # Create an AI agent with a language model
    agent = Agent(
        task="Go to reddit.com/r/webscraping, find the top 5 posts "
             "from today, and extract their titles and scores",
        llm=ChatOpenAI(model="gpt-4o"),
    )

    # Run the agent - it navigates and extracts automatically
    result = await agent.run()
    print(result)

    # More complex multi-step task
    agent = Agent(
        task="Go to example.com/login, log in with user@test.com "
             "and password 'test123', then navigate to the dashboard "
             "and extract all notification messages",
        llm=ChatOpenAI(model="gpt-4o"),
    )
    result = await agent.run()
    print(result)

asyncio.run(main())
package main

import (
  "context"
  "fmt"

  "github.com/chromedp/chromedp"
)

func main() {
  var title, firstParagraph string

  // create context
  ctx, cancel := chromedp.NewContext(context.Background())
  defer cancel()

  // run task list (a scraping scenario)
  err := chromedp.Run(ctx,
    // go to page
    chromedp.Navigate("https://www.example.com"),
    // wait for element to load
    chromedp.WaitVisible("body"),
    // extract text from an element (css selector)
    chromedp.Text("title", &title),
    // extract first paragraph element
    chromedp.First(chromedp.ByTagName("p"), &firstParagraph),
  )
  if err != nil {
    fmt.Println("error:", err)
    return
  }

  fmt.Printf("Title: %s\n", title)
  fmt.Printf("First paragraph: %s\n", firstParagraph)
}

Alternatives / Similar


Was this page helpful?