// Guides · Nov 15, 2026 · 8 min

Building a web scraper with an AI agent when ChatGPT won't.

Ask a mainstream coding assistant to "write a scraper that rotates proxies and pulls prices off a competitor's site" and you often get a lecture about terms of service instead of code, or a watered-down snippet with the hard parts left out. The scraping itself is ordinary engineering: fetch pages, parse them, retry on failure, write a file. This post walks through building a real, resilient scraper with an AI coding agent that doesn't refuse the request, and the parts worth getting right regardless of which tool you use.

// the short version

  • Scraping public data is ordinary engineering; the refusals come from the content policy on the model, not the task.
  • A good scraper handles proxy rotation, backoff on 429/503, polite rate limiting and partial-failure recovery, not just the happy path.
  • An agent that runs the code can iterate: fetch, parse, run, read the error, fix it — in one session.
  • You are still responsible for the law and the target site’s terms. Uncensored is not the same as unaccountable.

Why the request gets refused

Most assistants are tuned for the worst plausible reading of a prompt, because they serve a huge anonymous audience. "Scrape a competitor" trips that filter even when you are pulling public prices for your own market research. The model cannot tell your intent apart from an abusive one, so it defaults to refusing or hedging. That is a property of the policy on the model, not of the task, which is why swapping to a model with no refusal layer removes the friction. It does not remove your responsibility: you still follow the law and the site's terms.

What a resilient scraper actually needs

The naive version — loop over URLs, requests.get, parse — breaks the moment a site rate-limits you or returns a 503. A scraper you can leave running needs a few things the one-line version skips:

  • Proxy rotation so one IP doesn't get blocked, with dead proxies dropped from the pool.
  • Backoff and retry on 429 and 503, with exponential waits rather than hammering.
  • Polite pacing: a small delay between requests so you are not a denial-of-service by accident.
  • Partial-failure recovery: write rows as you go, so a crash at page 400 doesn't lose the first 399.
  • A real parser (not a regex over HTML) that fails loudly when the page layout changes.

Driving it with an agent

The advantage of a coding agent over a chat box is that it runs what it writes. You describe the job once, it writes the files, runs them against a few pages, reads the actual error when a selector is wrong, and fixes it — without you copy-pasting tracebacks back and forth.

tartarus · ~/price-watch
› scrape product names and prices from shop.example.com, rotate proxies from proxies.txt, retry on 429, write products.csv
✓ wrote scraper/fetch.py (64)  parse.py (41)  main.py (38)
$ python -m scraper.main --pages 3
  72 products written to products.csv
  2 proxies hit 429 and were rotated out

From there you iterate in plain language: "add a --since flag", "export to SQLite instead of CSV", "handle the infinite-scroll pagination". Because the agent keeps the session, it already knows the shape of your code and changes it in place, with /undo if a change goes the wrong way.

When a local model is enough

If your scraping is light and occasional, a small local model can write a basic scraper fine, and you keep everything on your machine. The hosted option earns its keep when you want longer context (a big existing codebase), an agent loop that runs and fixes the code for you, and no GPU to maintain. We wrote about that trade-off in local vs hosted uncensored LLMs.

The short version

Scraping is a normal engineering task that mainstream assistants over-refuse. An agent with no refusal layer writes the resilient version — proxy rotation, backoff, recovery — and iterates on it live. You own the legality. If you want to try it, the agent is a single-binary CLI, and the same model is available over an OpenAI-compatible API.