ScrapeGraphAI is the project behind this setup. This Windows setup uses the open-source Python library—not ScrapeGraphAI's paid cloud API. Ollama handles the AI work on your computer.
- Recommended method
- Windows, Python and Ollama
- Difficulty
- Intermediate
- Typical time
- 30–60 minutes plus downloads
What you need
- Windows 10 or 11
- Python 3.12 or newer—the current ScrapeGraphAI package requires at least 3.12
- Ollama and enough free storage for the model and browser download
- A public webpage you are permitted to access
- Comfort copying commands and creating one Python file
Set it up
Install Ollama and confirm it opens
Download the normal Windows installer from Ollama's official site. Open a new PowerShell window after installation and confirm the command is available.
ollama --versionDownload the local AI model
ScrapeGraphAI's current official example uses Llama 3.2. Pull it once, then send a tiny test prompt. The model remains on the computer for later runs.
ollama pull llama3.2 ollama run llama3.2 "Reply with the single word ready"Create an isolated Python project
Install Python 3.12 from Python's official Windows installer if needed. These commands create a separate environment and call its Python directly, avoiding PowerShell activation-policy problems.
mkdir scrapegraph-local cd scrapegraph-local py -3.12 -m venv .venv .\.venv\Scripts\python.exe -m pip install --upgrade pip .\.venv\Scripts\python.exe -m pip install scrapegraphai .\.venv\Scripts\python.exe -m playwright installCreate the first scraper
Create a file named scrape.py inside scrapegraph-local and paste this example. It uses Books to Scrape, a public practice site made for scraping exercises, and disables ScrapeGraphAI's documented anonymous telemetry before importing the package.
import os os.environ["SCRAPEGRAPHAI_TELEMETRY_ENABLED"] = "false" import json from pathlib import Path from scrapegraphai.graphs import SmartScraperGraph config = { "llm": { "model": "ollama/llama3.2", "model_tokens": 8192, "format": "json", }, "verbose": True, "headless": True, } scraper = SmartScraperGraph( prompt=( "Extract the first 10 visible books. For each book return " "only its title and displayed price. Do not guess missing values." ), source="https://books.toscrape.com/", config=config, ) result = scraper.run() output = json.dumps(result, indent=2, ensure_ascii=False) print(output) Path("result.json").write_text(output, encoding="utf-8")Run it and open the result
Keep Ollama running, then execute the script. The first run can take longer while the browser and model warm up. Open result.json when the command finishes.
.\.venv\Scripts\python.exe scrape.pyChange one thing at a time
Replace the prompt first and rerun the safe practice page. Once the fields are reliable, replace the source with a public page whose rules permit automated access. Keep the request small while measuring accuracy and speed.
Verify it works
Do not call the setup finished until these small tests pass:
- ollama list shows llama3.2
- The script finishes without asking for an API key or ScrapeGraphAI credits
- result.json contains titles and prices visible on the practice page
- A second run returns the same essential facts
- Every extracted value has been checked against the source
Protect the service
- Use only pages you are authorized to access and respect terms, robots instructions and rate limits
- Never use the setup to bypass logins, paywalls, CAPTCHAs or other access controls
- Local AI does not hide requests from the target website
- Do not collect sensitive personal information merely because it is technically visible
- Treat AI output as an unverified draft, especially for prices, dates and names
Official resources
Videos are supplemental. Use the official documentation for current commands, versions and security guidance.
