Skip to main content
Prerequisites
  • Python 3.10 or higher
  • PraisonAI Agents package installed
  • crawl4ai package installed and set up
The user shares a URL; the agent crawls the page and returns a concise summary. Crawl4AI provides powerful async web crawling with JavaScript rendering, content extraction, and LLM-based data extraction. PraisonAI includes built-in Crawl4AI tools for easy integration.

Quick Start

1

Install

2

Crawl a page

3

Use with agent

Installation

Setup

Built-in Crawl4AI Tool

PraisonAI provides built-in crawl4ai functions that you can use directly:

Available Functions

Basic Usage

Simple Crawl

Crawl with Options

Crawl Multiple URLs

Extract with CSS Selectors

Extract with LLM

Using Crawl4AITools Class

For more control, use the Crawl4AITools class directly:

Synchronous Usage

For non-async code, use the sync versions:

Schema Reference

CSS Extraction Schema

Field Types

JavaScript Execution

Execute JavaScript before crawling:

Wait Conditions

Video Tutorial

Key Points

  • Async by default: Use await for all crawl functions
  • JavaScript rendering: Full browser support for dynamic content
  • CSS extraction: Fast, no-LLM structured data extraction
  • LLM extraction: AI-powered extraction for complex content
  • Multi-URL: Efficient concurrent crawling

Best Practices

CSS selectors are faster and more reliable than LLM extraction for well-structured pages.
Use wait_for='css:.loaded' for pages that load content via JavaScript to avoid missing data.
crawl4ai_many crawls concurrently and is much faster than sequential calls for multiple URLs.
Prefer crawl4ai_sync for non-async scripts to avoid managing the event loop manually.

Custom Tools

Build your own agent tools

Tools Overview

Browse PraisonAI tool documentation