
ScrapeGraphAI
Python library that uses an LLM to scrape websites and local documents based on a plain-language prompt.
- Stars
- 32.4k
- Forks
- 3.3k
- Licence
- MIT
- Language
- Python
- Last update
- 1 months ago
- Type
- Library
What it is
ScrapeGraphAI is a Python web scraping library that uses large language models and graph-based pipelines to pull information from websites or local files such as HTML, XML, JSON, and Markdown. You describe the information you want in a sentence, and the library runs the scraping steps and returns the result. It is used by people who want structured data from pages without writing a custom parser for each site.
- Extract a company description, founders, and social links from a single web page using SmartScraperGraph
- Scrape the top search results for a query with SearchGraph
- Run one prompt across multiple pages with SmartScraperMultiGraph
- Generate a Python scraping script from a website with ScriptCreatorGraph
- Turn a page's extracted content into an audio file with SpeechGraph
Great for
- Developers who want to extract structured data from web pages using a plain-language prompt
- Data teams prototyping scrapers for pages with changing layouts
- People who want to run local models through Ollama and keep data on their own machines
- Builders connecting scraping to LLM or agent frameworks such as LangChain or LlamaIndex
Not ideal for
- Non-programmers, since usage requires writing Python code and configuring an LLM
- Anyone needing managed proxies and anti-bot handling, which the README assigns to the separate hosted API rather than the open-source library
- Users who cannot pay for or run an LLM, since the library depends on one for extraction
How to get it
- 1
Install with a package manager
You'll need: Python · Playwright browser binaries (installed via playwright install) · An LLM: an API key for a provider such as OpenAI, or Ollama for local models
Install the library
pip install scrapegraphaiInstall browser dependencies for fetching websites
playwright install - 2
Run it
- Install the library and run playwright install
- Create a graph_config with your chosen LLM (for example ollama/llama3.2 or openai/gpt-4o-mini)
- Create a SmartScraperGraph with a prompt and a source URL
- Call run() and print the returned result
- 3
Get the most out of it
- Use the multi-page graphs (SmartScraperMultiGraph, SearchGraph) to apply one prompt across many sources
- Switch the llm section of the config to change providers without changing the rest of the code
- Use the verbose and headless settings in the config to watch or hide the browser while debugging
- Connect it to LangChain, LlamaIndex, or CrewAI using the integrations listed in the README
Downloads
Strengths
- Extraction is driven by a natural-language prompt rather than hand-written selectors
- Supports many LLM providers, including OpenAI, Groq, Azure, Gemini, and local models via Ollama
- Released under the MIT license and has a large community with 32,000+ stars
Trade-offs
- Results depend on the chosen LLM and can vary, and the README does not describe accuracy guarantees
- Requires extra setup such as running playwright install to fetch website content and, for local models, installing Ollama
- The README pushes a separate hosted product in several places, so readers should check which option fits their needs
How it compares
| Project | Stars | Type | Level | Updated | Best for |
|---|---|---|---|---|---|
| Scrapegraph-ai (this) | 32.4k | Library | intermediate | 1 months ago | Developers who want to extract structured data from web pages using a plain-language prompt |
| spider-flow | 11.4k | App | intermediate | 3.4 years ago | Non-programmers who need to collect data from websites and prefer visual flow definitions |
| docling | 70k | Library | beginner | 5 days ago | Python developers building retrieval or RAG pipelines over PDFs and office files |
| llama_index | 52.8k | Library | intermediate | 10 days ago | Python developers building retrieval-augmented generation (RAG) apps over private documents |
| LightRAG | 40.5k | Library | intermediate | 7 days ago | Developers building question-answering over their own document collections |
| PageIndex | 40k | Library | intermediate | 7 days ago | Developers building question-answering over long PDFs such as annual reports or manuals |
Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.