Skip to content

crawl4aivsbrowser-use

Apache-2.0 54 5 63,373
1.5 million (month) May 01 2024 0.8.6(2026-03-24 15:07:50 ago)
87,251 30 226 MIT
Nov 01 2024 8.9 million (month) 0.12.6(2026-04-02 07:55:13 ago)

Crawl4AI is an open-source AI-powered web crawling and data extraction library for Python. It uses large language models (LLMs) to intelligently extract structured data from web pages with minimal code. Unlike traditional scraping frameworks that rely on CSS selectors or XPath, Crawl4AI can understand page content semantically and extract data based on natural language descriptions of what you want.

Key features include:

  • LLM-based extraction Define what data you want in plain English and Crawl4AI uses LLMs to find and extract it from the page content. Supports multiple LLM providers including OpenAI, Anthropic, and local models.
  • Automatic crawling Built-in crawler with support for JavaScript rendering, parallel crawling, and session management.
  • Structured output Returns data in structured formats (JSON, Pydantic models) making it easy to integrate into data pipelines.
  • Markdown conversion Can convert web pages to clean markdown format, useful for feeding content to LLMs.
  • Chunking strategies Multiple strategies for breaking down large pages into processable chunks for LLM extraction.
  • Async support Built on async Python for efficient concurrent crawling and extraction.

Crawl4AI is particularly useful for scraping unstructured content where writing traditional CSS/XPath selectors would be tedious or fragile. It excels at content extraction, article parsing, and data mining from diverse page layouts.

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-poweredasyncpopular
ai-powerednatural-languageasync

Example Use


```python from crawl4ai import AsyncWebCrawler, CrawlerRunConfig from crawl4ai.extraction_strategy import LLMExtractionStrategy import asyncio async def main(): # Basic crawling - get page as markdown async with AsyncWebCrawler() as crawler: result = await crawler.arun(url="https://example.com") print(result.markdown) # clean markdown content # AI-powered extraction with structured output strategy = LLMExtractionStrategy( instruction="Extract all product names and prices from this page", ) config = CrawlerRunConfig(extraction_strategy=strategy) async with AsyncWebCrawler() as crawler: result = await crawler.arun( url="https://example.com/products", config=config, ) print(result.extracted_content) # structured JSON output asyncio.run(main()) ```
```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?