Guide series · 9 guides

AI Web Scraping: How It Differs From Traditional Scraping

AI web scraping means using AI models, usually large language models (LLMs), to read web pages and pull out the data you ask for: instead of writing CSS selectors for each site, you describe the fields once, as a list or a JSON schema, and the model finds them on any page and returns structured data. The pages still have to be downloaded first, so AI scrapers need the same IPs, rendering and pacing as traditional scrapers, and they add a model cost per page and a risk of invented values. ProxyField supplies that download layer with residential proxies from $1.95/GB; start with the Easy Trial: 1 GB for $2.95.

residential IPs
412M+
from, traffic never expires
$1.95/GB
Easy Trial
1 GB for $2.95
On this page 10 sections
  1. What "AI scraping" means
  2. AI vs traditional web scraping: selectors or a schema
  3. How AI web scraping works
  4. How do I give a LangChain agent web access through a proxy?
  5. Which tools track brand mentions in Perplexity answers across hundreds of prompts?
  6. AI crawlers and the sites you scrape
  7. Is AI scraping legal?
  8. AI web scraping guides
  9. Sources
  10. AI Web Scraping FAQ

What "AI scraping" means

The phrase is used for two different things, and it helps to know which one a page is talking about.

MeaningWho does itWhat it involvesRead more
Scraping with AIYou, your scraper or your AI agentAn LLM extracts data from pages your scraper fetched, or an AI assistant browses and scrapes for youThis page, can ChatGPT scrape websites, web scraping with Claude
Scraping for AIAI companies and teams building modelsCrawlers collect web pages as training data or for retrieval (RAG)Web scraping for AI training and RAG

Both meet the same websites, the same blocks and the same rules; the law on both is in is AI scraping legal.

AI vs traditional web scraping: selectors or a schema

A traditional scraper finds each field by its place in the HTML, with a CSS selector or XPath you write for each site; an AI scraper finds each field by its meaning, from a schema you write once for every site. The difference in code:

Python
# Traditional: one selector per field, per site (Scrapy)
price = response.css(".product-card .price::text").get()

# AI: one schema for every shop; the model finds the field on each page
schema = {
    "type": "object",
    "properties": {
        "name": {"type": "string"},
        "price": {"type": ["number", "null"]},
        "currency": {"type": "string"},
        "in_stock": {"type": "boolean"},
    },
    "required": ["name", "price", "currency", "in_stock"],
}

The selector line is Scrapy's selector syntax; .get() returns the first match or None. When the shop renames .price, that line returns None until you fix it. The schema goes to the model with the cleaned page text, and the model answers with JSON in that shape. Open-source tools package this step: Crawl4AI, for example, fetches a page, turns it into Markdown and can pass it to an LLM with your schema. Selectors in detail: HTML scraping with CSS selectors and XPath.

How the two behave (typical behaviour of the tools, not measured figures):

FeatureTraditional scrapingAI web scraping
How fields are foundCSS selectors or XPath you write per siteThe model reads the page and finds the fields you describe
Setup for a new siteInspect the HTML, write and test selectorsReuse the field list or schema; often no new code
When the layout changesSelectors return nothing or the wrong element until you fix themUsually keeps working, because the field is found by meaning
Cost per pageBandwidth and compute onlyBandwidth plus the model's token cost, which grows with page length: 20,000 characters of page text is roughly 5,000 input tokens (about 4 characters per token, a rule of thumb)
SpeedMilliseconds to parseTypically seconds per page for the model call
AccuracyExact, or visibly brokenUsually right, sometimes a plausible but wrong value; validate
Blocks, CAPTCHAs, JavaScriptYour problemStill your problem: the model only sees what your fetcher downloaded

The model cost per month, to fill in with your own figures: input tokens per page ÷ 1,000,000 × the model's price per million input tokens × pages per month, plus the output tokens of the JSON. At 20,000 characters (about 5,000 tokens) per page, 100,000 pages a month are about 500 million input tokens; cleaning pages to text before the call is what keeps that number down.

The hybrid most teams end up with: the model writes the selectors, not the data. You ask an AI assistant to generate the scraper for a site, review the code, and run it as an ordinary scraper: cheap and exact per page, and when the layout changes you ask the model to repair the selectors. Keep model-per-page extraction for varied or messy pages, such as hundreds of shops with different layouts.

How AI web scraping works

An AI scraper is a pipeline of 5 steps, and only one of them is AI.

  1. Fetch

    Download the page with an HTTP client, or with a headless browser if it is built by JavaScript. This is where proxies, headers and pacing decide whether you get the page or a block.

  2. Clean

    Strip scripts, styles and navigation, and convert the rest to text or Markdown, so the model reads less and costs less.

  3. Extract

    Send the cleaned page to the model with the schema above and ask for JSON back; ask for null when a field is absent.

  4. Validate

    Check types, ranges and required fields; compare a sample against the page. Drop or re-run values that fail.

  5. Store

    Write rows to a database, a sheet or a vector store for retrieval.

The fetch and clean steps in Python, through a ProxyField residential IP:

Python
import requests
from bs4 import BeautifulSoup

PROXY = "http://<login>-country-us-city-new_york:<password>@gate.proxyfield.io:7000"
UA = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/156.0.0.0 Safari/537.36"  # use your browser's current string

html = requests.get(
    "https://example.com/product/123",
    proxies={"http": PROXY, "https": PROXY},
    headers={"User-Agent": UA},
    timeout=30,
).text

soup = BeautifulSoup(html, "html.parser")
for tag in soup(["script", "style", "nav", "footer"]):
    tag.decompose()
page_text = soup.get_text(" ", strip=True)[:20000]  # about 5,000 tokens; what you send to the model with the schema

Region, session and session time go in the same username: -region-<region>, -session-<id> and -ttl-<seconds> (30 to 129,600 seconds, 20 minutes by default), as in <login>-country-us-region-new_york-city-new_york-session-he9f2qga-ttl-600; every part after the login is optional.

The extract step: any LLM API with structured output (a JSON schema) takes page_text and the schema. With OpenAI's Python SDK, for example:

Python
import json
from openai import OpenAI  # other providers' structured-output APIs work the same way

schema["additionalProperties"] = False  # strict mode needs a closed schema
client = OpenAI()  # reads OPENAI_API_KEY
resp = client.responses.create(
    model="gpt-5-mini",
    input=[
        {"role": "system", "content": "Extract the product from the page text. Use null for a missing price; never guess."},
        {"role": "user", "content": page_text},
    ],
    text={"format": {"type": "json_schema", "name": "product", "schema": schema, "strict": True}},
)
product = json.loads(resp.output_text)
print(product)  # e.g. {'name': 'Trail Runner 2', 'price': 89.0, 'currency': 'USD', 'in_stock': True}

Then validate before you store: a price that is not a positive number, or a name that does not occur in page_text, sends the page back for a re-run or a review. Step-by-step versions with specific assistants are in can ChatGPT scrape websites and web scraping with Claude.

Vibe scraping is the newest variant: you describe the data in plain language, and an AI coding assistant writes, runs and fixes the scraper for you. It is fast for one-off jobs; for a recurring job, keep the generated code, review it and run it like any other scraper.

How do I give a LangChain agent web access through a proxy?

Put the proxy in the tool that fetches pages, not in the model: an agent reaches the web only through its tools. Either pass the proxy to the loader or tool you use, or set HTTP_PROXY and HTTPS_PROXY for tools you did not write.

In LangChain, the page loader WebBaseLoader (package langchain-community) takes a proxies dictionary:

Python
from langchain_community.document_loaders import WebBaseLoader

# one sticky US IP for the whole task (30 min); drop -session-...-ttl-... to rotate per request
PROXY = "http://<login>-country-us-session-agent01-ttl-1800:<password>@gate.proxyfield.io:7000"

loader = WebBaseLoader(
    ["https://example.com/pricing", "https://example.com/faq"],
    proxies={"http": PROXY, "https": PROXY},
    requests_per_second=2,
)
docs = loader.load()          # a list of Documents, one per URL
print(docs[0].page_content[:300])

What to expect: docs[0].page_content holds the page text, fetched from a ProxyField US IP; docs[0].metadata["source"] holds the URL. Things that trip people up:

  • proxies covers load() only. In the current source the async path (aload, alazy_load) opens its own aiohttp session and ignores proxies. For async loading, set the environment variables below and pass trust_env=True.
  • Tools you did not write: use environment variables. requests and httpx read HTTP_PROXY, HTTPS_PROXY and NO_PROXY. List your model provider's API host in NO_PROXY, so LLM calls go direct and only page fetches use (and are counted on) your proxy balance:
Shell
export HTTP_PROXY="http://<login>-country-us:<password>@gate.proxyfield.io:7000"
export HTTPS_PROXY="$HTTP_PROXY"
export NO_PROXY="localhost,127.0.0.1,<your model provider's API host>"
  • httpx changed its keyword. Current httpx takes httpx.Client(proxy=PROXY); proxies= is the older keyword, and httpx 0.28 and later reject it with TypeError: Client.__init__() got an unexpected keyword argument 'proxies'.
  • SOCKS5 works too: the same gateway and credentials as socks5h://<login>-country-us:<password>@gate.proxyfield.io:7000, after pip install "requests[socks]"; with socks5h the proxy resolves the host names. HTTPS pages go through a CONNECT tunnel that the gateway does not decrypt, so no certificate setup is needed.
  • Encode special characters in the password inside a proxy URL (@ becomes %40; urllib.parse.quote(password, safe="")).
  • A browser tool takes the proxy at launch, for example Playwright's proxy={"server": "http://gate.proxyfield.io:7000", "username": "<login>", "password": "<password>"}.

A fetch tool for the agent. To let the agent decide which pages to open, give it a tool of your own that fetches through the proxy:

Python
import requests
from bs4 import BeautifulSoup
from langchain_core.tools import tool

@tool
def fetch_page(url: str) -> str:
    """Fetch a public web page and return its visible text."""
    r = requests.get(url, proxies={"http": PROXY, "https": PROXY}, timeout=30)
    r.raise_for_status()
    return BeautifulSoup(r.text, "html.parser").get_text(" ", strip=True)[:20000]

print(fetch_page.invoke({"url": "https://api.ipify.org"}))  # expect the proxy's exit IP, not your server's

Pass fetch_page in the agent's list of tools; every page the agent opens then leaves from a ProxyField IP. Only if your network requires the model calls to go through a proxy too, give the chat model its own client: ChatOpenAI(model=..., http_client=httpx.Client(proxy=PROXY)). Otherwise keep the model's API host in NO_PROXY, so model calls are not counted on your proxy balance.

Three checks before an agent runs at volume:

  1. Test one IP first

    Fetch https://api.ipify.org through the proxy and compare the IP with your server's.

  2. Rotate for independent pages, stick for a task

    50 unrelated product pages: a new IP per request. Clicking through one site: one session id for the task. A sticky IP that sits idle for 120 seconds is replaced, so an agent that pauses longer between steps (a long model call) may continue on a new IP.

  3. Cap concurrency per site

    Agents can fire many requests at once; requests_per_second above, or your own limit, keeps the pace human-scale.

Which proxy type an agent needs, one session per agent and fleet sizing: the guide to proxies for AI agents. Agents connect to scraping tools through MCP servers more and more often: web crawl and scraping MCP servers. For self-hosted agent frameworks, see web scraping with OpenClaw.

Which tools track brand mentions in Perplexity answers across hundreds of prompts?

Six AI-visibility platforms name Perplexity, and one publishes a plan with hundreds of prompts on it: OtterlyAI Premium, 400 prompts checked daily on a monthly plan. Larger Perplexity prompt sets are on custom Enterprise plans (OtterlyAI from 1,000 prompts, Gauge, GetMentioned). For the raw answers in your own database, a pipeline on a Perplexity scraper API costs $13.50 for 300 prompts a day for 30 days (ProxyField's, in development).

Vendor pages (plans and prices change, so check before you buy):

ToolHundreds of Perplexity prompts?Your own prompts: quota and priceWhat it reports
OtterlyAIYes: Premium, 400Lite 15 prompts, Standard 100, Premium 400, each a monthly plan (prices on its pricing page); +100 prompts as a monthly add-on on Standard and Premium; Enterprise from 1,000. ChatGPT, AI Overviews, Perplexity and Copilot included; checked dailyBrand coverage, mentions, domain citations, competitors
GaugeOn Enterprise onlyGrowth plan: 600 prompts daily, 54,000 answers a month, on ChatGPT, Google AI Mode and Copilot, not Perplexity. Enterprise (custom price and prompt count) adds Perplexity among 6 platformsMention rate, citation rate, visibility score, competitors
GetMentionedOn Enterprise onlyStarter €89 a month for 25 prompts, Growth €199 for 100, Enterprise unlimited (custom); each prompt runs daily on ChatGPT, Perplexity and GeminiVisibility score, mention counts, trends, position per prompt
Ahrefs Brand RadarNo: up to 83 checks a dayCustom prompts from $50 a month: 5, 10 or 20 prompts (150, 300 or 600 checks a month); Enterprise from 2,500 checks. Each prompt uses 1 check per platform, location and update, so 2,500 checks a month is 83 prompts a day on one engine, or about 14 on six. AI Visibility Index: $199 a month, 83 prompts a day, 2,500+ checks, $0.020 per extra check. Plus a prebuilt index of 512M+ monthly prompts, 28.4M+ of them on PerplexityMentions, citations, AI share of voice, estimated impressions
Semrush AI Visibility ToolkitCheck the planBrand Performance reports by platform, Perplexity included; check the plan for custom prompt trackingShare of voice, mentions, average position, sentiment, citations
Peec AINot statedNames ChatGPT, Perplexity and Gemini; its pricing page shows no prompt counts or prices per planVisibility, position, sentiment, share of voice, sources

Pick by prompt count:

Your prompts on PerplexityFits
Up to 25Ahrefs custom prompts (5 to 20), OtterlyAI Lite (15), GetMentioned Starter (25)
26 to 100OtterlyAI Standard (100), GetMentioned Growth (100)
100 to 400 a dayOtterlyAI Premium (400), or Standard with +100 blocks
600 to 1,000+ a dayEnterprise plans: OtterlyAI (from 1,000), Gauge, GetMentioned
Any count, raw answers in your databaseYour own pipeline on a Perplexity scraper API: 300 prompts a day = 9,000 answers a month = $13.50

Past a platform's quota, or when you want the raw answers in your own database, building your own is the cheaper route. ProxyField's Perplexity scraper API is in development (Contact sales), so the pipeline column is its design and price, not a service you can call today:

FeatureAI-visibility platformYour own pipeline on a scraper API
What you getReady dashboards, competitor viewsEvery raw answer and its cited sources, in your database; no dashboards
Prompt countThe plan's quotaAs many as you pay for
Price basisMonthly planProxyField's Perplexity scraper API: $1.50 per 1,000 successful results, or $1.00 from 10,000 results in one purchase
400 prompts a day, 30 daysOtterlyAI Premium's monthly plan, 4 engines, with dashboards12,000 answers = $12.00 at $1.00 per 1,000 (from 10,000 in one purchase), Perplexity only, raw answers
300 prompts a day, 30 daysBetween OtterlyAI's Standard and Premium quotas9,000 answers = $13.50 at $1.50 per 1,000
Your workChoosing promptsScheduling, storing, parsing brands and sources, building reports

ProxyField's scraper APIs are in development: the design is in the API documentation, and access goes through Contact sales. They are billed on successful results only and paid from the same crypto balance as proxies, with no subscription:

APIWhat it returnsPrice per 1,000 successful results
Perplexity scraper APIThe Perplexity answer$1.50, or $1.00 from 10,000 results
ChatGPT scraper APIThe ChatGPT answer$1.50, or $1.00 from 10,000 results
Google AI Mode APIThe AI Mode answer$1.50, or $1.00 from 10,000 results
Google SERP APIThe results page as JSON, with the AI Overview, People Also Ask and the local pack parsed$1.20, or $0.80 from 10,000 results

All four are on the AI search scraper page.

AI crawlers and the sites you scrape

The other side of AI scraping is the crawlers AI companies run. OpenAI's GPTBot and OAI-SearchBot, Anthropic's ClaudeBot and Claude-SearchBot, and Common Crawl's CCBot announce themselves by user agent and follow robots.txt rules addressed to them, and many sites now block some or all of them. Two consequences for your own scraping:

AI web scraping guides

Sources

AI Web Scraping FAQ

How much does AI web scraping cost?

ProxyField's residential proxies for the fetch step cost $2.95/GB for 1 GB down to $1.95/GB from 1,000 GB, and the Easy Trial is 1 GB for $2.95. On top comes the model's token cost per page, which grows with page length, so cleaning pages to text before extraction cuts the bill. For high-volume pages with a stable layout, plain selectors avoid the model cost entirely.

What is AI scraping?

Web scraping in which an AI model, usually an LLM, reads the downloaded pages and extracts the data you describe, instead of selectors you write per site. The term is also used for AI companies crawling the web to collect training data.

Is AI web scraping better than traditional scraping?

It is better at varied or changing layouts and faster to set up, and worse at cost, speed and exactness per page. For stable, high-volume pages, selectors are cheaper and exact; many teams use AI to write and repair scrapers, and selectors to run them.

How does AI web scraping work?

A fetcher downloads the page through proxies, a cleaner strips it to text or Markdown, an LLM extracts the requested fields as JSON, and a validation step checks the values before they are stored. Only the extraction step is AI; blocks and JavaScript are handled by the fetcher as in any scraper.

What is an AI scraper?

A tool or script that uses an AI model to find and extract data on web pages, from a browser extension that reads the open page to a pipeline that processes millions of pages. Most also include a fetcher, and the larger ones a proxy pool.

What is vibe scraping?

Describing the data you want in plain language and letting an AI coding assistant write, run and fix the scraper, by analogy with "vibe coding". It works well for one-off jobs; for recurring ones, review and keep the generated code.

What counts as an LLM scraper?

Any scraper in which a large language model decides what to extract or where to go next: an extraction step that turns page text into JSON, or an agent that browses and chooses links itself. A scraper that only uses an LLM to write its code once is ordinary code afterwards.

Do AI scrapers hallucinate data?

They can: a model may fill a missing price, merge two products or reformat a value wrongly. Ask for null when a field is absent, use a JSON schema, validate types and ranges, and check a sample against the source pages.

Can AI scrapers handle JavaScript websites?

Only if their fetcher renders JavaScript: the model reads whatever HTML it is given, so a page built in the browser must be loaded in a headless browser first. Agents that drive a real browser handle it, at the cost of more time and traffic per page.

Do AI agents need proxies?

For a few pages, no. For many pages, protected sites or results from another country, yes: an agent's requests come from a server IP and get rate-limited and challenged like any scraper's, so its fetch tool needs rotating residential IPs and a location setting.

Show 7 more questionsShow fewer questions

What is an AI agent proxy?

A proxy configured for the tools an AI agent uses to reach the web, its HTTP fetcher or its browser, so the agent's requests leave from the proxy's IPs and location. It is an ordinary proxy; what changes is how rotation and sessions are set for the agent's tasks.

How do I give an AI agent built with LangChain web access through proxies?

Set the proxy in the tool that fetches pages: WebBaseLoader(url, proxies={"http": PROXY, "https": PROXY}).load(), with PROXY = "http://<login>:<password>@gate.proxyfield.io:7000" for ProxyField. For tools you did not write, set HTTP_PROXY, HTTPS_PROXY and NO_PROXY; the async loader needs those variables and trust_env=True. The model's own API calls do not need the proxy.

How should AI agents handle proxy IP rotation?

Rotate per request when the agent fetches independent pages, and keep a sticky session for any task that clicks through one site, signs in or fills a cart. Cap concurrency per site and retry failed fetches on a new IP after a pause.

Do ChatGPT answers vary by country, and how can I check them from different locations?

They can differ with the language and location of the question, especially for local, shopping and news queries. To compare, send the same prompts from IPs in each country, or use an API that returns the answers by location: ProxyField's ChatGPT scraper API, in development, is priced at $1.50 per 1,000 successful results, or $1.00 from 10,000 results.

How do companies monitor their brand's visibility in AI search answers at scale?

They run a fixed set of prompts on a schedule across ChatGPT, Perplexity, Google AI Mode and AI Overviews, from the countries they sell in, then store the answers, the brands named and the sources cited, and track changes over time. An AI-visibility platform does this inside its prompt quota; a pipeline on scraper APIs does it at any prompt count.

Which tools track brand mentions in Perplexity answers across hundreds of prompts?

With a published plan, OtterlyAI Premium: 400 prompts checked daily on Perplexity, ChatGPT, AI Overviews and Copilot on its monthly plan, with +100 prompts as a monthly add-on. Gauge and GetMentioned put Perplexity at that scale only on custom Enterprise plans (Gauge's Growth plan covers 600 prompts but not Perplexity), and Ahrefs Brand Radar counts one check per prompt, platform, location and update, so its 2,500 checks a month are 83 prompts a day on one engine. For raw answers in your own database, a pipeline on ProxyField's Perplexity scraper API, in development through Contact sales, costs $13.50 for 300 prompts a day for 30 days at $1.50 per 1,000 successful results.

Can AI scrape competitor prices?

Yes: an AI extractor can read prices from many differently built shops with one schema, which saves writing a scraper per shop. Fetch the pages through residential IPs in the shop's country so you see local prices, and validate prices against the page before you act on them; more in price monitoring.

Easy Trial: 1 GB for $2.95.

Try for the price of 1 GB, no subscription, traffic never expires.