Skip to content

crawl4aivsferret

Apache-2.0 54 5 63,373
1.5 million (month) May 01 2024 0.8.6(2026-03-24 15:07:50 ago)
5,964 8 34 Apache-2.0
Oct 28 2020 58.1 thousand (month) v2.0.0-alpha.7(2026-04-07 15:33:51 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.

Ferret is a web scraping system. It aims to simplify data extraction from the web for UI testing, machine learning, analytics and more. ferret allows users to focus on the data. It abstracts away the technical details and complexity of underlying technologies using its own declarative language. It is extremely portable, extensible, and fast.

Features

  • Declarative language
  • Support of both static and dynamic web pages
  • Embeddable
  • Extensible

Ferret is always implemented in Python through pyfer

Highlights


ai-poweredasyncpopular

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()) ```
```go // Example scraper for Google in Ferret: LET google = DOCUMENT("https://www.google.com/", { driver: "cdp", userAgent: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.87 Safari/537.36" }) HOVER(google, 'input[name="q"]') WAIT(RAND(100)) INPUT(google, 'input[name="q"]', @criteria, 30) WAIT(RAND(100)) CLICK(google, 'input[name="btnK"]') WAITFOR EVENT "navigation" IN google WAIT_ELEMENT(google, "#res") LET results = ELEMENTS(google, X("//*[text() = 'Search Results']/following-sibling::*/*")) FOR el IN results RETURN { title: INNER_TEXT(el, 'h3')?, description: INNER_TEXT(el, X("//em/parent::*")), url: ELEMENT(el, 'a')?.attributes.href } ```

Alternatives / Similar


Was this page helpful?