Back to Crawl4ai

App Name

docs/md_v2/marketplace/frontend/app-detail.html

0.8.62.2 KB
Original Source

Quick Start

Get started with this integration in just a few steps.

Installation

bashCopy

pip install crawl4ai

Basic Usage

pythonCopy

from crawl4ai import AsyncWebCrawler

async def main():
    async with AsyncWebCrawler() as crawler:
        result = await crawler.arun(
            url="https://example.com",
            # Your configuration here
        )
        print(result.markdown)

if __name__ == " __main__":
    import asyncio
    asyncio.run(main())

Advanced Configuration

Customize the crawler with these advanced options:

🚀 Performance

Optimize crawling speed with parallel processing and caching strategies.

🔒 Authentication

Handle login forms, cookies, and session management automatically.

🎯 Extraction

Use CSS selectors, XPath, or AI-powered content extraction.

🔄 Proxy Support

Rotate proxies and bypass rate limiting with built-in proxy management.

Integration Example

pythonCopy

from crawl4ai import AsyncWebCrawler, CrawlerRunConfig, CacheMode
from crawl4ai import LLMConfig
from crawl4ai.extraction_strategy import LLMExtractionStrategy

async def extract_with_llm():
    async with AsyncWebCrawler() as crawler:
        result = await crawler.arun(
            url="https://example.com",
            config=CrawlerRunConfig(
                extraction_strategy=LLMExtractionStrategy(
                    llm_config=LLMConfig(
                        provider="openai/gpt-4o",
                        api_token="your-api-key",
                    ),
                    instruction="Extract product information"
                ),
                cache_mode=CacheMode.BYPASS
            )
        )
        return result.extracted_content

# Run the extraction
data = await extract_with_llm()
print(data)

💡 Pro Tip

Use cache_mode=CacheMode.BYPASS for a fresh crawl, or CacheMode.WRITE_ONLY to avoid refetching.

Documentation

Complete documentation and API reference.

Examples

Real-world examples and use cases.

Support

📧 Contact

[email protected]

🐛 Report Issues

Found a bug? Report it on GitHub Issues.

💬 Community

Join our Discord for help and discussions.