Skip to content

splashvsbrowser-use

BSD-3-Clause 399 15 4,193
446 (month) Apr 25 2014 3.5(2020-06-16 13:27:02 ago)
87,251 30 226 MIT
Nov 01 2024 8.9 million (month) 0.12.6(2026-04-02 07:55:13 ago)

Splash is a javascript rendering service with an HTTP API. It's a lightweight browser with an HTTP API, implemented in Python 3 using Twisted and QT5.

It is built on top of the QtWebkit library and allows developers to interact with web pages in a headless mode, which means that the web pages are rendered in the background, without displaying them on the screen.

splash is particularly useful for web scraping and web testing tasks, as it allows developers to interact with web pages in a way that is very similar to how a human user would interact with the browser.

It also allows you to execute javascript and interact with web pages even if they use heavy javascript.

Unlike Selenium or Playwright, splash is powered by webkit embedded browser instead of a real browser like Chrome or Firefox. As a down-side splash requests are easy to detect and block when scraping websites with anti-scraping features.

One benefit of splash is that it seemlesly integrates with Scrapy.

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.

Highlights


ai-powerednatural-languageasync

Example Use


```python # once splash server is started it can be requested to render pages through # HTTP requests: import requests url = "http://localhost:8050/render.html" payload = { 'url': 'https://www.example.com', 'timeout': 30, 'wait': 2 } response = requests.get(url, params=payload) # Get the page HTML print(response.text) ```
```python 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()) ```

Alternatives / Similar


Was this page helpful?