Logo of «2Captcha»To home page
Captcha bypass tutorials

Was this helpful?

How to scrape Webmotors

Gregory Fisher
Gregory Fisher

Technical engineer

Webmotors (webmotors.com.br) is one of Brazil's main marketplaces for new and used cars and motorcycles. Every listing shows the price, make, model and version, both years, mileage, the seller and the city, and next to it the price as a percentage of the FIPE table, the reference price list Brazilians use to value vehicles. If you want to know what a 2020 Corolla really costs in São Paulo, or which sellers price above FIPE, that's your source.

This is one of the few sites in the 2scraper family where you can't start without paying for anything or bringing your own connection. Webmotors sits behind CloudFront and PerimeterX, and every datacenter address tested was refused before the site even saw the request. You need a residential IP: your own home connection or a residential proxy. Once you have one, the data comes from the site's own JSON API and is very clean.

This guide uses the open-source Webmotors scraper from the 2scraper project. It reads any Webmotors search, for cars or motorcycles, plus individual adverts, and writes one row per listing to JSON or CSV. The figures below come from the project's README, changelog and troubleshooting notes, each with the date it was measured.

What you get

Two modes:

Mode One row per What's in it
search (default) listing on a search page Price, make, model, version, year built and model year, mileage, transmission, body, colour, doors, engine, horsepower, armoured, the seller's ticked facts, the price against FIPE, the "Bom negócio" badge, seller type, city and state. 41 columns
ad advert Most of that plus fuel, the plate's last digit, optional equipment, a dealer's description, when the advert was created, the FIPE code and value, and the site's own market price range for that version and year. A car's engine size, horsepower and traction are missing here, so take them from a search run. 50 columns

The columns you'll use most:

Field What's in it
sku Webmotors' advert ID
price, currency Price in Brazilian reais (BRL)
make, model, version E.g. VOLKSWAGEN, GOL, 1.6 MI CITY 8V FLEX 4P MANUAL
year_fabrication, year_model Year built and model year. In Brazil the model year is often one ahead, e.g. 2013/2014
odometer_km Mileage in kilometres
attributes What the seller ticked: "Aceita troca" (trade-in accepted), "IPVA pago" (annual vehicle tax paid), "Único dono" (single owner), "Licenciado" (licensed)
fipe_pct The price as a percentage of the FIPE table value
good_deal The site's "Bom negócio" (good deal) badge
seller_type, seller_kind private or dealer, and the site's own label: "Pessoa Física", "Concessionária" and so on
city, state Where the car is
fipe_code, fipe_price The FIPE code and value (ad mode)
market_price_min, market_price_avg, market_price_max The site's market price range for that version and year (ad mode)
final_plate The last digit of the plate (ad mode). In Brazil it decides the licensing calendar and São Paulo's driving rotation

Private sellers are people, and the scraper treats them that way. A private seller's record carries their postal code and their own description of the car, and the advert adds their first name. None of that is written: seller_name is empty for every private seller and description is kept for dealers only. City and state stay. A dealer's trading name is a business's public name and is kept.

What you need

  • Python 3.9 or newer (CI tests 3.9 and 3.12).
  • Playwright with Chromium, the recommended engine. Selenium and pyppeteer versions exist too.
  • One virtual environment per engine; their libraries pin incompatible versions of shared dependencies.
  • A residential IP. Either run from your own home connection, use a residential proxy, or use the 2Captcha Browser API, which runs a browser on a residential exit for you.

Installation

bash Copy
git clone https://github.com/2scraper/webmotors-scraper.git
cd webmotors-scraper
python3 -m venv .venv
source .venv/bin/activate  # Windows: .venv\Scripts\activate

pip install -r requirements.txt -r requirements-playwright.txt
playwright install chromium

cp .env.example .env      # then put your residential proxy in WEBMOTORS_PROXY
python3 env_config.py     # shows which settings were loaded, without printing secrets

A 2Captcha residential proxy goes into .env like this:

bash Copy
WEBMOTORS_PROXY=http://{user}-zone-custom-region-br:{password}@na.proxy.2captcha.com:2334

The country is the -region-br part of the login. Keep credentials in .env, never on the command line.

First run

bash Copy
# Every Volkswagen Gol in Brazil, three pages of 47
python3 playwright_scraper.py --make volkswagen --model gol --pages 3

# The cheapest Corollas from 2020 on in the state of São Paulo
python3 playwright_scraper.py \
  --url "https://www.webmotors.com.br/carros/sp/toyota/corolla?anode=2020" \
  --sort price-asc --pages 5

# Honda motorcycles, newest model year first
python3 playwright_scraper.py --category motos --make honda --sort year-desc

# Then every advert that search found, with FIPE and market prices
python3 playwright_scraper.py --mode ad --ads-file webmotors_rows.json --out adverts

You can build a search with flags (--category carros or motos, --condition all, used or new, --state sp, --make, --model) or pass any search address from the site with --url, filters included. Not both: the scraper refuses a URL plus filter flags, because merging them could scrape something neither described.

Defaults are --pages 1, 47 listings per page (--per-page goes up to 100), --delay 1, --retries 3, --format both and --out webmotors_rows. --sort takes relevance (the site's default), price-asc, price-desc, year-desc and km-asc.

How the scraper works

Data from the site's own API

The rows come from the JSON API the Webmotors front end uses, not from the visible page. That's why the fields are so clean: numbers are numbers, years are split into built and model year, and the seller type is a field rather than a guess. The browser is there to get past CloudFront and PerimeterX and to make the API calls the way the site does.

Search mode reads search results. Ad mode takes the adverts from a search run (--ads-file) and requests each one, plus the market price range for its version and year. An advert that has been sold or withdrawn isn't a failure: it's listed in the sidecar's ads_gone and the run goes on.

A misspelt model gives you more results, not fewer

This is the biggest trap on Webmotors. /carros/estoque/volkswagen/gool answers HTTP 200 with every Volkswagen on the site, 48,983 of them on 2026-09-28. An unknown make returns the whole catalog, an unknown state the whole country. So after page 1 the scraper reads back what the site actually applied and stops with exit code 2 if it isn't what you asked for:

Copy
The site did not recognise the model 'gool' (the site applied every
VOLKSWAGEN model), and answered with HTTP 200 and 49,140 listing(s) anyway.

Spell makes and models the way the site's own addresses do: onix-plus, mercedes-benz, hb20. The easiest way is to open the search on webmotors.com.br and copy the path.

Around 10,000 results per search, at most

348,317 cars matched the unfiltered search, and the site offered 213 pages of 47, about 10,011 listings. A run that fetches all of them is complete as a request and still a sample. The sidecar says capped_by_site: true when that happens. To reach the rest, narrow the search by state, make or price range.

Sorting decides which cars are in the file

On a capped search the order isn't cosmetic. Under the default "Mais relevantes" (most relevant), the first 47 cars of the whole catalog were 31 franchise dealers, 16 used-car lots and no private sellers. Under "Menor preço" (lowest price) they were 44 private sellers. Those are two different samples. So the sort order is a column in every row, the sidecar records it, and diff_runs.py refuses to compare runs sorted differently. An o= parameter in the address is ignored by the site; only --sort changes the order.

A page past the end is page 1 again

Page 500 of a 40-page search returned HTTP 200, ten rows of page 1 and PageCurrent: 500 echoed back. The scraper plans pages from the count the site states on page 1. A page holding only rows it already has ends the run only beyond that count. Inside it, such a page just means the listing moved between requests (see below), and the run carries on.

The listing moves while you read it

"Mais relevantes" reorders itself within minutes: two runs of the same search 20 minutes apart shared 89 of their first 94 listings. A car that moves across a page boundary during a run gets fetched twice (the duplicate is dropped and logged) or not at all. That's the site, not the scraper. For more repeatable runs, sort by price or year.

Blocks, proxies and paid options

What gets refused

Measured on 2026-09-28:

Client Address Result
Anything: curl, headless or headful Chromium datacenter CloudFront 403, before the site sees the request
2Captcha Scraper API on its own exits its own refused (CloudFront, then PerimeterX on a retry)
curl residential PerimeterX 403, its Press & Hold page
Headless Chromium with its default user agent residential PerimeterX 403, 0 of 3
Headless Chromium without "HeadlessChrome" in the user agent residential served, 3 of 3
Chromium with a window residential, Brazil and US served, 2 of 2 each
2Captcha Browser API its own served

So two things are needed. The first is a residential address. The second is a browser that doesn't announce itself. Headless Chromium says "HeadlessChrome" in its user agent, and PerimeterX refuses that. It also refuses a user agent override that doesn't update the matching client hints, which is exactly what pyppeteer's setUserAgent does. The engines take care of the second part: they send an ordinary Chrome user agent with the browser's real version and matching client hints, and nothing more.

Residential proxies: expect some refusals

On a rotating residential gateway, each fresh browser gets a new IP, and CloudFront accepts only some of them. Out of twelve fresh browsers, a -region-br login was served 5 times and a -region-us login 9 times. The country doesn't matter to the site; a US exit simply did better that day. That's why the scraper retries a refused page three times, each time from a fresh browser, which a rotating gateway answers with a new IP. PerimeterX also refused a correctly configured browser now and then during live runs, and a fresh browser was then served. A single refusal isn't a verdict. If a run still fails, try the other region or pass several exits with --proxy-file.

A residential proxy is billed by traffic, so the scraper saves what it can:

  • A pre-check before any browser starts. One request through the proxy finds out whether the gateway accepts your credentials. A 407 (wrong login or no traffic left) or 402 (balance exhausted) ends the run in seconds with exit 5 and a clear reason, instead of a string of timeouts. Chromium itself reports a 407 as a navigation timeout, which is why this check exists.
  • A traffic cap. By default a run through a proxy stops at 10 MB (--proxy-budget-mb, 0 means no cap). It keeps the rows it has and exits 6, or 5 if it got none. The sidecar records the bytes used, and the log ends with "Proxy traffic: X.X MB of Y MB budget". Against a test proxy that counted every byte, the estimate was within 0.2% for Playwright and under 1% for the other engines.
  • Optional media blocking. --block-media stops images, video and fonts from loading. It's off by default, because PerimeterX has refused the scraper for smaller inconsistencies, and whether it reacts to missing images couldn't be measured. Test it on your own exit before relying on it.

Proxy lists can be generated with the Proxy API.

2Captcha Browser API

The Browser API (--cdp-endpoint) is a remote browser on a residential exit, and it was served on every attempt measured. You install nothing and buy no proxy traffic. A profile allows one live connection, so there's no --concurrency through it. Playwright and pyppeteer can connect; Selenium can't, because chromedriver can't pass a password. If the connection fails with 401, copy the endpoint again from the dashboard; a 500 usually means another run still holds the profile.

Scraper API and fingerprints

The Scraper API on its own exits was refused, so on Webmotors scraper_api_client.py only works together with a Browser API session (--cdp-url), at $0.0005 per page on 2026-09-28. Fingerprints (--fingerprint) aren't needed here: the engines' own identity was served.

No captcha to solve

PerimeterX does have a Press & Hold challenge, but none of the scraper's clients was shown it once the two fixes above were in place. The scraper doesn't implement solving it, and captcha solving buys nothing on this site today.

Output files and exit codes

Each run writes the results and a .meta.json sidecar with the status, the pages fetched, the site's own total, whether the cap applied, the sort order and the currency. A run through a proxy also writes .latest_attempt.meta.json, so a failed attempt never overwrites the sidecar of your last good run. A search that matches nothing writes nothing unless you pass --allow-empty, and even then only a genuinely empty search writes an empty file: a blocked or failed run never replaces your earlier output. Next to pages_failed the sidecar lists pages_unattempted, the planned pages the run never got to.

Code Meaning
0 Done
1 Crash
2 Bad usage, including a make, model or state the site didn't recognise
3 Blocked: CloudFront (the address) or PerimeterX (the client)
4 The search matched nothing
5 The data never arrived: a timeout, a dead proxy, refused credentials or balance, the traffic cap spent before any row
6 Partial: some pages came back, a later one didn't, some listings on a page couldn't be read, or the traffic cap stopped the run

On exit 3 the log names what refused you. "cloudfront" means the address: use a residential proxy or the Browser API. "perimeterx" means the client: try --headful (under xvfb-run on a server), another exit or the Browser API.

Traps that look like bugs

  • A typo returns tens of thousands of cars. See above: the site widens the search instead of failing, and the scraper stops with exit 2.
  • Two runs disagree on which cars are in the file. Either the sort orders differ, or "Mais relevantes" reshuffled in between. Sort by price or year for more repeatable samples.
  • seller_name is empty. For private sellers, on purpose. Dealers keep their names.
  • An advert is missing from ad mode output. It's in ads_gone: the site answered 404 because the car was sold or withdrawn.
  • You asked for 300 pages and got 213. The site's cap of about 10,000 results per search is already in the page count it reports.
  • stop_reason: parser_found_nothing. The site sent listings and none could be read, which means the API's format changed. It's not an empty search. The page is saved next to the output for a bug report.
  • stop_reason: parser_lost_records. Some listings on a page couldn't be read while the rest could. The readable rows are kept, but the run stops as partial with exit 6, because the API's format is starting to change.
  • Engine size and horsepower are empty in ad mode. The advert endpoint doesn't return a car's engine size, horsepower or traction (5 of 5 car adverts on 2026-11-18), while a search run fills them for the same cars. Join the two runs on sku if you need both.

Comparing runs

bash Copy
python3 diff_runs.py --old gol_mon.json --new gol_tue.json --fail-on-change

diff_runs.py compares two runs by sku and reports added, removed and changed listings. It tracks every column of the row except the ones that describe the run itself (scrape time, page, position, sort), so a price cut, a mileage correction or a new "IPVA pago" all show up. In ad mode, a change in the market price range shows up too. It refuses to compare runs that aren't both complete, runs of different modes and runs of different queries: a different address, page size or, most importantly, sort order. On a capped search, the sort decides which cars are in the file at all. --force overrides the refusal if you really mean it.

Sample rows

A search row from the repository's sample_output.json, captured on 2026-09-28 (selected fields):

json Copy
{
  "url": "https://www.webmotors.com.br/comprar/volkswagen/gol/16-mi-city-8v-flex-4p-manual/4-portas/2013-2014/74012141",
  "sku": "74012141",
  "title": "VOLKSWAGEN GOL 1.6 MI CITY 8V FLEX 4P MANUAL",
  "price": 35900.0,
  "currency": "BRL",
  "condition": "used",
  "year_fabrication": 2013,
  "year_model": 2014,
  "odometer_km": 173000,
  "transmission": "Manual",
  "body_type": "Hatchback",
  "color": "Preto",
  "horsepower_cv": 104,
  "attributes": ["Aceita troca", "IPVA pago", "Licenciado"],
  "fipe_pct": 94,
  "good_deal": true,
  "seller_type": "private",
  "seller_kind": "Pessoa Física",
  "seller_name": null,
  "city": "São Paulo",
  "state": "SP",
  "sort": "relevance"
}

A private seller in São Paulo asking 94% of FIPE, with the "Bom negócio" badge. The name is empty, as it should be.

And an advert from sample_output_ad.json:

json Copy
{
  "sku": "69474521",
  "title": "VOLKSWAGEN GOL 1.0 12V MPI TOTALFLEX 4P MANUAL",
  "price": 58700.0,
  "year_fabrication": 2022,
  "year_model": 2023,
  "odometer_km": 69583,
  "fipe_pct": 107,
  "good_deal": false,
  "fuel": "Gasolina e álcool",
  "final_plate": 6,
  "optionals": ["Airbag", "Ar condicionado", "Freio ABS", "Bluetooth", "..."],
  "created_at": "2026-05-15T02:35:02",
  "fipe_code": "005490-9",
  "fipe_price": 54821.0,
  "market_price_min": 42500.0,
  "market_price_avg": 56228.05,
  "market_price_max": 69990.0,
  "seller_type": "dealer",
  "seller_kind": "Concessionária",
  "seller_name": "Seminovos Movida São Bernardo do Campo",
  "city": "São Bernardo do Campo",
  "state": "SP"
}

A dealer asking R$58,700 against a FIPE value of R$54,821, which is the 107% in fipe_pct, and a little above the site's market average of R$56,228. The advert has been online since May.

Using the results: who prices below FIPE

FIPE gives every car a reference price, so fipe_pct is a ready-made "cheap or expensive" signal. A first report: the typical percentage by seller type, and the listings well below FIPE with reasonable mileage.

python Copy
import json
from collections import defaultdict
from statistics import median

rows = json.load(open("webmotors_rows.json", encoding="utf-8"))

by_seller = defaultdict(list)
for r in rows:
    if r.get("fipe_pct"):
        by_seller[r["seller_type"]].append(r["fipe_pct"])

for seller, pcts in by_seller.items():
    print(f"{seller:<8} {len(pcts):>4} listings, median {median(pcts)}% of FIPE")

print("\nBelow 90% of FIPE, under 100,000 km:")
for r in sorted(rows, key=lambda r: r.get("fipe_pct") or 999):
    if (r.get("fipe_pct") or 999) < 90 and (r.get("odometer_km") or 0) < 100_000:
        print(f"  {r['fipe_pct']}%  R${r['price']:,.0f}  {r['year_model']}  "
              f"{r['odometer_km']:,} km  {r['city']}/{r['state']}  {r['url']}")

Two things to keep in mind. A low FIPE percentage can have a reason the listing doesn't show, like an accident history or high mileage for the year. And the sort order shapes the sample: a relevance-sorted search is dealer-heavy, a price-sorted one is mostly private sellers. Compare like with like.

Limitations

  • Needs a residential IP or the Browser API; datacenter addresses are refused.
  • Around 10,000 results per search. Narrow by state, make or price to go further.
  • PerimeterX's Press & Hold challenge isn't solved; the scraper avoids it instead.
  • Selenium can't use a proxy with a password or an authenticated remote browser.
  • Private sellers' names and descriptions aren't collected.
  • --condition (used or new) is available for cars only.

Common questions

Why doesn't it work from my server?
CloudFront refuses every datacenter address, before the site sees the request. Use a residential proxy or the Browser API.

Which proxy country should I use?
The site doesn't care. In one test a US residential exit was accepted more often than a Brazilian one. Try both.

Why did a search for one model return every car of the make?
The model name was spelt differently from the site's own address. The scraper stops with exit 2 rather than write the wrong sample. Copy the spelling from the site's URL.

What is FIPE?
The FIPE table is Brazil's standard reference price list for vehicles. fipe_pct shows the asking price as a percentage of it, and ad mode adds the FIPE code and value.

How much proxy traffic does a run use?
The scraper measures it and stops at 10 MB by default. The sidecar and the last log line show how much was used.

Is it legal to scrape Webmotors?
The scraper reads public pages, logs into nothing, contacts no seller and doesn't store private sellers' names or contacts. Whether your use is allowed depends on your jurisdiction and the site's terms, so check both and keep a delay between requests. This isn't legal advice.

Wrapping up

Webmotors is the reverse of most sites in this series: the data is clean and structured, and getting to it is the hard part. Bring a residential IP, spell models the way the site does, and pick a sort order deliberately, because on a capped search it decides which cars you get.

Getting started: clone the repository and run it from your home connection, or sign up for 2Captcha and add residential proxies or the 2Captcha Browser API.

Source code

Documentation