Scrapegraph-ai
ActiveDescription
Python scraper based on AI that uses LLMs and knowledge graphs to automatically build web data extraction pipelines.
Key Features
- SmartScraperGraph — Single-page pipeline extracting structured data with just a prompt and URL
- SearchGraph — Multi-page pipeline extracting info from top N search engine results
- ScriptCreatorGraph — Auto-generates Python scraping scripts from webpage content
- Multi-Model Support — Compatible with OpenAI, Ollama, Groq, Azure, Gemini and other LLM backends
- MCP Server Integration — Can serve as an MCP tool callable by AI agents
- Multi-Format Support — Handles XML, HTML, JSON, Markdown and other local document formats
Use Cases
Categories
Quick Start
pip install scrapegraphai
playwright install
from scrapegraphai.graphs import SmartScraperGraph
graph_config = {
"llm": {"model": "ollama/llama3.2"},
"verbose": True,
"headless": False,
}
scraper = SmartScraperGraph(
prompt="Extract product info from this page",
source="https://example.com/product",
config=graph_config
)
print(scraper.run())