WORKFLOW SNAPSHOT
- Compare a public profile’s visible layout across a controlled set of visitor conditions.
- Suggested starting behavior: Timed session
- Validate the real application and destination
A practical Instagram workflow
Compare a public profile’s visible layout across a controlled set of visitor conditions.
- Define the public profile, locale, and browser viewport.
- Keep the cookie jar and route together during each observation.
- Check whether the response is a profile, a login page, or an unavailable-content screen.
Where should an Instagram session boundary sit in a proxy test?
Treat the profile page and its dependent requests as one observation. Keep the assignment stable for that observation and rotate only between independent runs where the workflow calls for it. A short session window that expires mid-load can create an avoidable extra variable.
What should you verify before scaling Instagram profile observations?
An IP change does not create consent to collect private content or permission to automate account activity. Visual availability can vary for reasons unrelated to the proxy.
Validate the expected page structure and capture the browser conditions alongside the observation.
Verify the Instagram connection boundary
Check that the returned document is the public profile you expected rather than a login or verification view. Record browser locale, visitor state and viewport because they can change the visible layout independently of the proxy.
Classify an Instagram profile response before layout QA
Save one public-profile HTTP response to identify a profile, unavailable-content document or login view before running browser assertions.
- 01Generate your endpoint
Choose HTTP / HTTPS and Sticky session for the complete workflow 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 public Instagram profile URL for the layout scenario; omit private-content links and any session-bearing parameters.https://www.instagram.com/PUBLIC_HANDLE/Set PS_EXPECT_TEXT to the public username or a profile-specific text substring present in the document. This optional check inspects the returned text without running JavaScript.
Python 3.10+ · python -m pip install requests · python ps_instagram.py# Save one public-profile HTTP response to identify a profile, unavailable-content document or login view before running browser assertions.
# Set PS_TARGET_URL to the exact permitted public Instagram profile URL for the layout scenario; omit private-content links and any session-bearing parameters.
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://www.instagram.com/PUBLIC_HANDLE/
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("instagram-profile-classification.html").write_bytes(body)
print(json.dumps({
"workflow": "instagram", "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.
Look for the expected profile identity in the body and inspect the status and content type when it is absent; an access screen can also return HTML successfully, while viewport-dependent layout and client-rendered elements still require the controlled browser scenario.
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: verify a public profile layout reproducibly
Define a public-profile presentation assertion rather than a vague requirement that Instagram should work. For example, the test may check whether the expected profile identity appears and whether a known public element is present. Keep viewport and browser state together while comparing observations.
Classify an access-required page, unavailable content, and the expected profile separately. This helps a UI test report a meaningful outcome instead of treating every missing element as a network outage.
{
"handle": "PUBLIC_HANDLE",
"viewport": "RECORD_VIEWPORT",
"page_state": "RECORD_STATE",
"expected_element": "RECORD_ASSERTION",
"result": "RECORD_RESULT"
}Instagram verification checklist
For this Instagram workflow, record profile, viewport and page state 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 |
|---|---|---|
| Profile | Exact public handle | The expected profile identity |
| Viewport | Device size and browser version | A comparable layout |
| Page state | Profile, access-required, or unavailable | A correctly classified observation |
Troubleshoot Instagram results and connection errors
| Symptom | Check next | What the result tells you |
|---|---|---|
| Expected element absent | Confirm page state first | A different document can explain missing selectors |
| Layout differs | Compare viewport and locale | A UI variation may be independent of route |
| Unexpected account | Check isolated browser context | Session storage selected another visitor state |
Keep Instagram layout comparisons tied to the same page state
Choose a known profile and list the public layout elements under review. Compare like-for-like visitor contexts, save the actual page outcome and record missing fields explicitly. Treat an unavailable element as a result to classify before changing selectors or increasing concurrency.
A LITTLE CLARITY
Common questions.
Are static exits the same as isolated Instagram identities?
No. Account identity and browser storage remain application state; an exit assignment is only a network property.
Why record the page state before checking selectors?
Selectors are meaningful only on the expected document. A login or unavailable screen should be classified before a profile assertion runs.
What should you verify before scaling Instagram profile observations?
Check that the returned document is the public profile you expected rather than a login or verification view. Record browser locale, visitor state and viewport because they can change the visible layout independently of the proxy.