The Page You See Depends on Where You Look

Two visitors with identical requests get different pages if their IPs live in different countries. Sites geo-target for licensing, language, currency and legal reasons, and a scraper has to both understand the signal it is receiving and control the geography it presents. This lesson covers how geo-blocking works, how to test it, and when controlling it is a legal daylight decision.

How Servers Guess Where You Are

The dominant signal is the IP address: geo-IP databases map addresses to countries, and sites either serve localized content or block entirely (regional licensing is a classic reason). Secondary signals are Accept-Language headers (UI language) and, for cdns and streaming, the edge node that served you. If a page looks "wrong", check the geo before debugging your parser — a "Price in $ instead of €" bug is often a geography bug.

import requests
r = requests.get("https://example.com/pricing")                # your real IP
print(r.url, r.json().get("currency"))                          # what they gave YOU

Test geography explicitly before you blame selectors or layout. Hit the URL through two exits — your local IP and a proxy or VPN in the target region — and diff the responses. If they differ, the site is geo-gating and every subsequent decision is a geo decision.

Controlling the Exit: Geo Proxies

To see a regional variant you need an IP that appears to live there: a residential or ISP proxy in that country (the proxies-and-rotation lesson covers choosing pools; here the pool must be regional). Some proxy sellers let you pin a country explicitly. Remember the mismatch trap: it looks worse for a bot to claim Accept-Language: fr while the IP says US — align the language header with the exit's region:

headers = {
    "Accept-Language": "fr-FR,fr;q=0.9,en;q=0.8",
    "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) ...",
}
r = requests.get(url, proxies={"http": geo_proxy, "https": geo_proxy},
                 headers=headers)

Measure the exit before trusting it — a "Belgian" proxy that resolves to a Germany IP will quietly hand you the wrong currency and worse, the wrong dataset. Curl a geo-echo endpoint (https://ipinfo.io/json or your region of choice) once per proxy session and log what you actually got.

Persist the Locale in the Data

Geo-gated data is regional data. Store the locale along with the record — country, currency, and the resolved variant URL — so you can join variant A and variant B later and answer "did price differ by region?" without a second crawl. The cleaning lesson's normalize step should split a price into amount + currency precisely because currency branding is information, not noise.

The Legal Keep-Out Line

Choosing an exit to see a page the site deliberately hides by region is the anti-bot and legal gray zone this course keeps flagging. Streaming platforms geo-block for licensing; e-commerce geo-targets for regulations and pricing. Before geo-spoofing past a deliberate block, re-read the legal-considerations lesson and the target's ToS — region-gated data is more likely to be lawfully protected than merely scrapable. Detect, document, and cry bug-checks before you ever spoof; the scraping win is collecting the localized data that is meant to be public in your region, mapped cleanly.