WORKFLOW SNAPSHOT
- Inspect a known query for regional presentation differences in a controlled browser context.
- Suggested starting behavior: Per-request rotation
- Validate the real application and destination
A practical Yandex workflow
Inspect a known query for regional presentation differences in a controlled browser context.
- Set a stable query and record the intended language.
- Capture the visible regional context where available.
- Classify result, consent, and challenge pages separately.
How should Yandex regional checks use independent assignments?
Change assignments between independent permitted observations rather than halfway through one results-page journey. Keep the browser’s regional settings and language explicit because a different exit alone does not define the whole search context.
Which Yandex query and region settings must be verified before scale?
An observed country is not the same as every location preference used by a search service. Do not attribute all variation to the proxy.
Compare equivalent page types and store enough context to reproduce the observation later.
Verify the Yandex connection boundary
Record exact query, locale, requested regional context, visitor state and page outcome. Check whether the returned document contains results or asks for consent, verification or authentication.
Record a Yandex query document with its regional context
Retrieve one Yandex query document to preserve the response class and any server-provided regional text for an independent observation.
- 01Generate your endpoint
Choose HTTP / HTTPS and Every request for independent observations in Configure proxies.
- 02Set your proxy URL
Set
PS_PROXY_URLtohttp://USERNAME:PASSWORD@HOST:PORTusing your generated endpoint. For IP authentication, whitelist your machine and usehttp://HOST:PORT. Percent-encode special characters in credentials; these are proxy credentials, separate from your account password or API key. - 03Choose the destination
Set
Example URL · replace placeholders with your targetPS_TARGET_URLbefore running the code. Use the exact permitted Yandex results URL, retaining the encoded query and your chosen regional or language parameters rather than relying on exit country alone.https://example.com/qa/yandex/search?text=proxy+testingSet PS_EXPECT_TEXT to a known query-result substring or visible region label from the document being compared. This optional check inspects the returned text without running JavaScript.
Python 3.10+ · python -m pip install requests · python ps_yandex.py# Retrieve one Yandex query document to preserve the response class and any server-provided regional text for an independent observation.
# Set PS_TARGET_URL to the exact permitted Yandex results URL, retaining the encoded query and your chosen regional or language parameters rather than relying on exit country alone.
import hashlib
import json
import os
import time
from pathlib import Path
from urllib.parse import urlsplit
import requests
class InspectSession(requests.Session):
# Leave redirect bodies streamed instead of preparing the next request.
def resolve_redirects(self, *args, **kwargs):
return iter(())
proxy = os.environ["PS_PROXY_URL"] # HTTP endpoint from ProxySight
target = os.environ["PS_TARGET_URL"] # https://example.com/qa/yandex/search?text=proxy+testing
if urlsplit(proxy).scheme != "http":
raise ValueError("Use your generated HTTP proxy endpoint for this example.")
if urlsplit(target).scheme not in ("http", "https"):
raise ValueError("PS_TARGET_URL must be an HTTP or HTTPS URL.")
with InspectSession() as client:
client.trust_env = False # No ambient proxy, NO_PROXY or netrc overrides
started = time.monotonic()
with client.get(
target,
proxies={"http": proxy, "https": proxy},
headers={"Accept-Language": "en-US,en;q=0.9"},
timeout=(10, 20), allow_redirects=False, stream=True,
) as response:
body = bytearray()
for chunk in response.iter_content(16384):
body.extend(chunk)
if len(body) > 1048576:
raise RuntimeError("Response exceeds this example's 1 MiB limit.")
Path("yandex-regional-query.html").write_bytes(body)
print(json.dumps({
"workflow": "yandex", "status": response.status_code,
"elapsed_ms": round((time.monotonic() - started) * 1000),
"bytes": len(body), "sha256": hashlib.sha256(body).hexdigest(),
"headers": {name: response.headers.get(name) for name in ['Content-Type', 'Content-Language', 'Location']},
}, indent=2))
expected = os.getenv("PS_EXPECT_TEXT", "")
if expected:
text = body.decode(response.encoding or "utf-8", errors="replace")
print("Expected text:", "found" if expected in text else "absent")
# A 200 status alone does not prove the intended page was returned.
# Inspect redirects, login prompts, 403 and 429 before another request.
Inspect the body for the intended query, visible regional context where present, and result-page content; save challenge or consent HTML as its own outcome, since a successful HTTP transfer does not establish a complete result set or render all regional modules.
Response bodies are limited to 1 MiB for a small diagnostic. TLS verification stays enabled; redirects are left for you to inspect. Connection guide
Example: preserve regional context in a search observation
For a permitted regional search check, record the query, page language, and any visible regional context relevant to the result. Preserve that context with the parsed output rather than assuming the exit country fully defines the visitor location.
Compare like-for-like document types within the same research window. A consent page, unavailable response, or challenge should be stored as its own outcome and should not become an empty successful result set.
{
"query": "YOUR_QUERY",
"language": "RECORD_LANGUAGE",
"regional_context": "RECORD_VISIBLE_CONTEXT",
"document_class": "RECORD_CLASS"
}Yandex verification checklist
For this Yandex workflow, record query, regional context and document class alongside the actual result. Use the evidence below to decide whether another observation is comparable before increasing the workload.
| Checkpoint | Hold constant or record | Expected evidence |
|---|---|---|
| Query | Exact phrase and language | Repeatable input |
| Regional context | Visible setting or classification source | Context attached to the observation |
| Document class | Result, consent, challenge, or unavailable | Correct parsing path selected |
Troubleshoot Yandex results and connection errors
| Symptom | Check next | What the result tells you |
|---|---|---|
| Unexpected region | Compare site settings and route observation | The site can use additional location signals |
| Empty output | Check document class before selectors | Distinguish missing data from a different page |
| Different modules | Record page layout and time | Compare equivalent result types |
Record Yandex location context separately from the exit country
Use a small known query set and compare the same scenario close in time. Save the regional settings and visible results with the observation. Investigate an unexpected page type before updating selectors or increasing the number of requests.
A LITTLE CLARITY
Common questions.
Will a proxy choose a precise search city?
Only an explicitly supported targeting feature could make that promise; country selection alone does not.
Why keep the displayed regional context?
It documents what the application presented, which may differ from a separate IP-location lookup.
Which Yandex query and region settings must be verified before scale?
Record exact query, locale, requested regional context, visitor state and page outcome. Check whether the returned document contains results or asks for consent, verification or authentication.