<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Lsr</title>
    <description>The latest articles on DEV Community by Lsr (@seencxy).</description>
    <link>https://dev.to/seencxy</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4233232%2Fd72422a4-5c3c-4932-87ba-8d1392d989cc.png</url>
      <title>DEV Community: Lsr</title>
      <link>https://dev.to/seencxy</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/seencxy"/>
    <language>en</language>
    <item>
      <title>AWS WAF challenge: you need the script URL, not just the token</title>
      <dc:creator>Lsr</dc:creator>
      <pubDate>Tue, 10 Nov 2026 02:28:05 +0000</pubDate>
      <link>https://dev.to/seencxy/aws-waf-challenge-you-need-the-script-url-not-just-the-token-2hdd</link>
      <guid>https://dev.to/seencxy/aws-waf-challenge-you-need-the-script-url-not-just-the-token-2hdd</guid>
      <description>&lt;p&gt;Most anti-bot walls ask one question: where is the sitekey? Turnstile hands you one, DataDome binds its token to the page you were on, Akamai hands you a script block. AWS WAF's &lt;strong&gt;Challenge&lt;/strong&gt; action is different. There is no sitekey, and nothing that looks like one.&lt;/p&gt;

&lt;p&gt;What you get instead is a challenge script URL. Almost every AWS WAF integration I see fail, fails in one of three places: the field name, where the script URL came from, and the clock.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the browser was doing
&lt;/h2&gt;

&lt;p&gt;When a page is protected by the WAF challenge action, the browser does four things: loads a small script the WAF injected into the page, runs it, receives an &lt;code&gt;aws-waf-token&lt;/code&gt; cookie, and sends that cookie on every subsequent request. If you drop the cookie in without the script context, you are sending a token with no relationship to the session the WAF is scoring.&lt;/p&gt;

&lt;h2&gt;
  
  
  The two inputs
&lt;/h2&gt;

&lt;p&gt;An AWS WAF task takes exactly two required fields:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "type": "awswaf",
  "task": {
    "websiteURL": "https://example.com/protected",
    "WafScriptUrl": "https://example.com/challenge.js?..."
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;websiteURL&lt;/code&gt; is the page you actually want to reach, without credentials in it.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;WafScriptUrl&lt;/code&gt; is the full URL of the challenge script &lt;strong&gt;as served on that page&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  The casing is not cosmetic
&lt;/h3&gt;

&lt;p&gt;It is &lt;code&gt;WafScriptUrl&lt;/code&gt;. Not &lt;code&gt;wafScriptUrl&lt;/code&gt;, not &lt;code&gt;waf_script_url&lt;/code&gt;. Field names in this API are case-sensitive and a wrong case comes back as &lt;code&gt;400 INVALID_TASK&lt;/code&gt;, which reads like a validation bug until you diff your JSON against the reference.&lt;/p&gt;

&lt;h3&gt;
  
  
  The query string is the whole point
&lt;/h3&gt;

&lt;p&gt;The script URL carries the parameters that identify which distribution and which protected resource you are solving for. A script URL captured from a different host, a different section of the site, or an older deploy can still return a token — the token is just scoped to something that is not your target, so the target rejects it. Copy the full URL including the query string, from the actual blocked page, and do not trim it.&lt;/p&gt;

&lt;p&gt;Practical way to find it: open the blocked page, view source, and search for the script tag the WAF injected into the document. It is served from the site's own domain and it is the only script on the page with that shape.&lt;/p&gt;

&lt;h2&gt;
  
  
  No custom user agent — but proxies are fine
&lt;/h2&gt;

&lt;p&gt;Unlike most task types, &lt;code&gt;awswaf&lt;/code&gt; has no &lt;code&gt;useragent&lt;/code&gt; request field. If you need a proxy you send &lt;code&gt;proxyType: http&lt;/code&gt; with address, port and optional credentials, and then you have one rule: &lt;strong&gt;same egress every time&lt;/strong&gt;. The returned &lt;code&gt;solution.useragent&lt;/code&gt; belongs to the session that earned the token. Send the token from a different IP, or with a different UA than the one that came back, and you have rebuilt the mismatch you were trying to avoid.&lt;/p&gt;

&lt;h2&gt;
  
  
  The timer matters more than the token
&lt;/h2&gt;

&lt;p&gt;Solving is asynchronous, and it is the timing that trips up retry logic:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;create returns &lt;code&gt;202&lt;/code&gt; with a task id, status usually &lt;code&gt;queued&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;poll &lt;code&gt;GET /v1/tasks/{id}&lt;/code&gt; every 2–3 seconds&lt;/li&gt;
&lt;li&gt;the soft processing limit for this type is &lt;strong&gt;180 seconds&lt;/strong&gt;; the current node timeout is around 100 seconds&lt;/li&gt;
&lt;li&gt;after the soft limit a task can move to &lt;code&gt;uncertain&lt;/code&gt; — not failed, not done&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The one retry mistake worth naming: do not recreate a task with a fresh &lt;code&gt;Idempotency-Key&lt;/code&gt; because the first one looked slow. The accepted task can still resolve, and you have now paid for two. Keep the key tied to the business request, not to the attempt.&lt;/p&gt;

&lt;h2&gt;
  
  
  Reading the result
&lt;/h2&gt;

&lt;p&gt;Only read &lt;code&gt;solution&lt;/code&gt; when &lt;code&gt;status&lt;/code&gt; is &lt;code&gt;completed&lt;/code&gt;, and expect the token in either of two places:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;solution.value&lt;/code&gt; — the verification token directly&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;solution.cookies["aws-waf-token"]&lt;/code&gt; — the cookie form&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Then send it as the &lt;code&gt;aws-waf-token&lt;/code&gt; cookie against the target domain, together with &lt;code&gt;solution.useragent&lt;/code&gt; if a proxy was used. The platform's response is authoritative about which shape you got; do not assume one.&lt;/p&gt;

&lt;h2&gt;
  
  
  Failure modes, in the order you will meet them
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Symptom&lt;/th&gt;
&lt;th&gt;Usually means&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;400 INVALID_TASK&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;wrong field casing, missing script URL, or a URL with credentials&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;503 TYPE_UNAVAILABLE&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the type is not in &lt;code&gt;GET /v1/prices&lt;/code&gt; on your account&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;429 TASK_LIMIT_EXCEEDED&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;concurrency, not balance&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;token accepted, then 403&lt;/td&gt;
&lt;td&gt;script URL from the wrong page, or egress/UA changed mid-session&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;TASK_FAILED&lt;/code&gt; after ~100s&lt;/td&gt;
&lt;td&gt;script URL reachable by the page but not by the solver&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  A short checklist
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Copy the script URL from the blocked page, query string intact.&lt;/li&gt;
&lt;li&gt;Keep &lt;code&gt;WafScriptUrl&lt;/code&gt; capitalised.&lt;/li&gt;
&lt;li&gt;Pin one egress and reuse &lt;code&gt;solution.useragent&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Poll every 2–3 seconds, keep the idempotency key stable.&lt;/li&gt;
&lt;li&gt;Read &lt;code&gt;value&lt;/code&gt; or &lt;code&gt;cookies&lt;/code&gt; — whichever is present.&lt;/li&gt;
&lt;/ol&gt;




&lt;p&gt;&lt;em&gt;I maintain &lt;a href="https://www.tiam.codes" rel="noopener noreferrer"&gt;SolveHub&lt;/a&gt;, the API in the examples above — it returns tokens and clearance cookies for authorised testing of pages you are allowed to test. The AWS WAF reference, including every field limit, is at &lt;a href="https://www.tiam.codes/docs?guide=awswaf" rel="noopener noreferrer"&gt;tiam.codes/docs?guide=awswaf&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>aws</category>
      <category>security</category>
      <category>python</category>
      <category>webscraping</category>
    </item>
    <item>
      <title>Akamai _abck: the cookie that rewrites itself on every response</title>
      <dc:creator>Lsr</dc:creator>
      <pubDate>Tue, 10 Nov 2026 01:12:07 +0000</pubDate>
      <link>https://dev.to/seencxy/akamai-abck-the-cookie-that-rewrites-itself-on-every-response-1gep</link>
      <guid>https://dev.to/seencxy/akamai-abck-the-cookie-that-rewrites-itself-on-every-response-1gep</guid>
      <description>&lt;p&gt;Akamai Bot Manager is the one anti-bot product where the cookie is the least interesting part of the story. Everyone fixates on &lt;code&gt;_abck&lt;/code&gt;. What actually decides whether your next request passes is the sequence of updates &lt;code&gt;_abck&lt;/code&gt; went through — and the headers that came back with it.&lt;/p&gt;

&lt;p&gt;This post is about three things that break Akamai automation in practice: treating &lt;code&gt;_abck&lt;/code&gt; as a one-time token, discarding &lt;code&gt;bm_sz&lt;/code&gt; and &lt;code&gt;ak_bmsc&lt;/code&gt; because &lt;code&gt;_abck&lt;/code&gt; looks like the important one, and ignoring &lt;code&gt;solution.headers&lt;/code&gt; because no other solver returns any.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Scope: everything below is for QA automation on properties you are authorised to test.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Three cookies, three jobs
&lt;/h2&gt;

&lt;p&gt;Akamai hands out cookies in layers, and each one answers a different question.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;ak_bmsc&lt;/code&gt; — the anonymous browser session. It is issued before any sensor data runs, it is short-lived, and on its own it gets you a page, not an API.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;bm_sz&lt;/code&gt; — the session marker that pairs with &lt;code&gt;_abck&lt;/code&gt;. They are set together and they are checked together. A request carrying a healthy &lt;code&gt;_abck&lt;/code&gt; but no matching &lt;code&gt;bm_sz&lt;/code&gt; is a very common way to get re-challenged while your logs say "the cookie is fine".&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;_abck&lt;/code&gt; — the state carrier. It holds the sensor payload and the verdict on that payload.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you only keep one, keep &lt;code&gt;_abck&lt;/code&gt; — but understand that on its own it is half a conversation.&lt;/p&gt;

&lt;h2&gt;
  
  
  Reading the verdict inside _abck
&lt;/h2&gt;

&lt;p&gt;A &lt;code&gt;_abck&lt;/code&gt; value is a &lt;code&gt;~&lt;/code&gt;-separated blob. Two segments matter more than the rest:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A &lt;code&gt;~-1~&lt;/code&gt; segment means a sensor post is still expected, or the one that was sent was not accepted.&lt;/li&gt;
&lt;li&gt;A &lt;code&gt;~0~&lt;/code&gt; segment means the sensor data was accepted and the browser is validated.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A long value can contain both markers in different positions, because the value accumulates state. So the check is not "does the cookie contain ~0~": it is which marker comes last, and whether the segment count went up or down since the previous response.&lt;/p&gt;

&lt;p&gt;This is also why status codes lie on Akamai more than on any other product. A &lt;code&gt;200 OK&lt;/code&gt; with a challenge document in the body and a &lt;code&gt;~-1~&lt;/code&gt; cookie is a block. A &lt;code&gt;403&lt;/code&gt; is almost the easy case: it is the one failure the status code actually reports.&lt;/p&gt;

&lt;h2&gt;
  
  
  The rewrite: why replaying the solve value fails
&lt;/h2&gt;

&lt;p&gt;Akamai does not issue &lt;code&gt;_abck&lt;/code&gt; once. Most responses carry a &lt;code&gt;Set-Cookie&lt;/code&gt; that replaces it with a longer value and a different marker. That is the point of the design: the cookie is a record of the session's behaviour, so the server extends it as the session continues.&lt;/p&gt;

&lt;p&gt;Concretely, if you solve once, store the cookie, and replay it for the next two hundred requests, you are replaying state one of a conversation the server has already advanced past. It works — until it does not, usually a few requests in, and usually with no signal other than a challenge page.&lt;/p&gt;

&lt;p&gt;The fix is mechanical: keep a per-session cookie jar, and update it from every response, not just from the solve. Then verify the marker after each update rather than trusting the status code.&lt;/p&gt;

&lt;h2&gt;
  
  
  Headers are part of the credential
&lt;/h2&gt;

&lt;p&gt;This is where Akamai differs from every other solver integration I maintain. Its solve result includes &lt;code&gt;solution.headers&lt;/code&gt; — browser headers to reuse in subsequent requests — and the field is explicitly documented as possibly &lt;code&gt;null&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;When it is present, replay it. When it is &lt;code&gt;null&lt;/code&gt;, fall back to &lt;code&gt;solution.useragent&lt;/code&gt; and keep your own header set consistent with it: same &lt;code&gt;Accept-Language&lt;/code&gt;, same &lt;code&gt;sec-ch-ua&lt;/code&gt; family, same header order. A UA that says Chrome 131 with a &lt;code&gt;sec-ch-ua&lt;/code&gt; for Chrome 108 is exactly the sort of mismatch the sensor data is built to catch.&lt;/p&gt;

&lt;h2&gt;
  
  
  When the marker never flips: task.ApiURL
&lt;/h2&gt;

&lt;p&gt;Some Akamai-protected applications only validate the session after a specific XHR or POST — the price lookup, the search call, the cart estimate. Until that request happens inside the session, &lt;code&gt;_abck&lt;/code&gt; stays at &lt;code&gt;~-1~&lt;/code&gt; no matter how clean the browser is.&lt;/p&gt;

&lt;p&gt;For that case the task takes an &lt;code&gt;ApiURL&lt;/code&gt; field: the POST target to request within the browser session. The response body is not returned as part of the solve result — you are not scraping that call, you are using it to make the session real. If you are getting valid-looking cookies that are still rejected, a missing &lt;code&gt;ApiURL&lt;/code&gt; is the first thing I would check.&lt;/p&gt;

&lt;h2&gt;
  
  
  The loop, correctly shaped
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt;

&lt;span class="no"&gt;BASE&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;environ&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"SOLVEHUB_URL"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;rstrip&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"/"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="no"&gt;H&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"Authorization"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="s2"&gt;"Bearer {os.environ['SOLVEHUB_API_KEY']}"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="n"&gt;payload&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="s2"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"akamai"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s2"&gt;"task"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="s2"&gt;"websiteURL"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"https://example.com/product/42"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s2"&gt;"ApiURL"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"https://example.com/api/price?sku=42"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="c1"&gt;# optional but often decisive&lt;/span&gt;
        &lt;span class="s2"&gt;"proxyType"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"http"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s2"&gt;"proxyAddress"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"203.0.113.10"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s2"&gt;"proxyPort"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"8080"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="n"&gt;task_id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="s2"&gt;"{BASE}/v1/tasks"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;headers&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="no"&gt;H&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;timeout&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;30&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"taskId"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="kc"&gt;True&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;t&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="s2"&gt;"{BASE}/v1/tasks/{task_id}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;headers&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="no"&gt;H&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;timeout&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;30&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"status"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s2"&gt;"completed"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;sol&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"solution"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
        &lt;span class="k"&gt;break&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"status"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"failed"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"cancelled"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;raise&lt;/span&gt; &lt;span class="nc"&gt;RuntimeError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"errorCode"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sleep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;jar&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sol&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"cookies"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;          &lt;span class="c1"&gt;# _abck, bm_sz, ak_bmsc&lt;/span&gt;
&lt;span class="n"&gt;extra&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sol&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"headers"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;   &lt;span class="c1"&gt;# documented as possibly null&lt;/span&gt;
&lt;span class="n"&gt;session&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Session&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;session&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;cookies&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;update&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;jar&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;session&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"User-Agent"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sol&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"useragent"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="n"&gt;session&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;update&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;extra&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;session&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;proxies&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"http"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"http://203.0.113.10:8080"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                   &lt;span class="s2"&gt;"https"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"http://203.0.113.10:8080"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;marker&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;cookie_value&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;segs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;cookie_value&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"~"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;segs&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"0"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"-1"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;session&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"https://example.com/product/42"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;timeout&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;30&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;session&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;cookies&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;update&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;cookies&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;          &lt;span class="c1"&gt;# keep the rewrite, not just the seed&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nf"&gt;marker&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;session&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;cookies&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"_abck"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"-1"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;raise&lt;/span&gt; &lt;span class="nc"&gt;RuntimeError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"challenge in disguise: 200 with a pending sensor marker"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two details in that snippet are the ones people skip. &lt;code&gt;session.cookies.update(r.cookies)&lt;/code&gt; after every response — that is the rewrite. And the marker check reading the last marker segment rather than testing for the substring &lt;code&gt;~0~&lt;/code&gt;, because a value that contains both markers is normal and is not a pass.&lt;/p&gt;

&lt;h2&gt;
  
  
  The five-item check
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Am I replaying the seed cookie, or the updated one from the last response?&lt;/li&gt;
&lt;li&gt;Do I carry &lt;code&gt;bm_sz&lt;/code&gt; and &lt;code&gt;ak_bmsc&lt;/code&gt; alongside &lt;code&gt;_abck&lt;/code&gt;?&lt;/li&gt;
&lt;li&gt;Does the last marker segment read &lt;code&gt;0&lt;/code&gt;, not just exist?&lt;/li&gt;
&lt;li&gt;If &lt;code&gt;solution.headers&lt;/code&gt; was not null, did I actually send them?&lt;/li&gt;
&lt;li&gt;Does the page need an &lt;code&gt;ApiURL&lt;/code&gt; POST before the session is considered real?&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  The rule
&lt;/h2&gt;

&lt;p&gt;On Akamai the cookie is not a key you are handed, it is a ledger the server keeps updating. Read the last marker, store every rewrite, send back the headers that came with it, and let the body — not the status code — tell you whether you passed.&lt;/p&gt;

&lt;p&gt;I maintain SolveHub, a CAPTCHA and anti-bot solving API for authorised testing. The Akamai endpoint, its request fields and the &lt;code&gt;ApiURL&lt;/code&gt; behaviour are documented at &lt;a href="https://www.tiam.codes/docs/akamai" rel="noopener noreferrer"&gt;https://www.tiam.codes/docs/akamai&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;Reference version of this material, if you want the tables without the narrative: the &lt;a href="https://seencxy.github.io/glossary/akamai-abck/" rel="noopener noreferrer"&gt;_abck cookie glossary entry&lt;/a&gt; covers the value format, the four bindings and the 403 triage ladder. The same set has &lt;a href="https://seencxy.github.io/glossary/reese84/" rel="noopener noreferrer"&gt;reese84&lt;/a&gt;, &lt;a href="https://seencxy.github.io/glossary/px3/" rel="noopener noreferrer"&gt;_px3&lt;/a&gt; and &lt;a href="https://seencxy.github.io/glossary/cf-clearance/" rel="noopener noreferrer"&gt;cf_clearance&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>security</category>
      <category>python</category>
      <category>webscraping</category>
      <category>akamai</category>
    </item>
    <item>
      <title>PerimeterX _px3: the two expiries that kill your cookie (and the s2s path that has none)</title>
      <dc:creator>Lsr</dc:creator>
      <pubDate>Mon, 09 Nov 2026 15:28:59 +0000</pubDate>
      <link>https://dev.to/seencxy/perimeterx-px3-the-two-expiries-that-kill-your-cookie-and-the-s2s-path-that-has-none-5ah5</link>
      <guid>https://dev.to/seencxy/perimeterx-px3-the-two-expiries-that-kill-your-cookie-and-the-s2s-path-that-has-none-5ah5</guid>
      <description>&lt;p&gt;PerimeterX (today HUMAN Security) does not ask your scraper a question at request time. It hands out a cookie, &lt;code&gt;_px3&lt;/code&gt;, that says "this visitor already passed", and then it decides later - server-side, per request - whether to still believe that sentence. That is why a &lt;code&gt;_px3&lt;/code&gt; solved ten minutes ago can be dead, while one issued an hour later keeps working.&lt;/p&gt;

&lt;p&gt;This post is about the two separate expiries inside a PerimeterX deployment: the lifetime baked into the cookie, and the risk score that can override it. Then the server-to-server variant, where there is no cookie to reuse at all.&lt;/p&gt;

&lt;p&gt;Scope: everything below is for QA automation on properties you are authorised to test.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is actually inside &lt;code&gt;_px3&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;A &lt;code&gt;_px3&lt;/code&gt; value is a colon-separated blob, not opaque randomness. Its payload carries the application ID the cookie was minted for (the &lt;code&gt;PX...&lt;/code&gt; value in the page bootstrap), a visitor identifier, an issue time and an expiry chosen by the server, and an HMAC computed over those fields together with the IP and User-Agent of the original request.&lt;/p&gt;

&lt;p&gt;Two consequences follow immediately:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The cookie is bound to a network and a device fingerprint. Move it to another IP or swap the UA and the signature stops verifying.&lt;/li&gt;
&lt;li&gt;The expiry sits inside the signed payload, so you can read when it dies - but you cannot extend it. Only the collector can mint a new one.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Clock one: the expiry in the payload
&lt;/h2&gt;

&lt;p&gt;Every &lt;code&gt;_px3&lt;/code&gt; carries the moment it stops being accepted. For high-risk sessions that window is short - minutes, sometimes barely longer than the time it takes to load one page. For sessions that look clean it can stretch to hours. Neither number is a constant of the product; both come from the tenant configuration and from how the visitor behaved.&lt;/p&gt;

&lt;p&gt;Practically, this means any code that stores &lt;code&gt;_px3&lt;/code&gt; with a hardcoded "valid for one hour" assumption is wrong in both directions: it wastes good cookies and, far worse, it sends dead ones.&lt;/p&gt;

&lt;h2&gt;
  
  
  Clock two: risk decay
&lt;/h2&gt;

&lt;p&gt;The second expiry is not a number at all. PerimeterX scores the session continuously. A session that passed an hour ago but now does something out of character - new User-Agent mid-session, navigation faster than a human can click, a datacenter IP where a residential one was used before - gets re-scored, and the next response comes back with a different verdict: a fresh &lt;code&gt;_px3&lt;/code&gt; with a much shorter TTL, or a challenge.&lt;/p&gt;

&lt;p&gt;So the TTL is an upper bound, not a promise. Treat the payload expiry as "at most this long", and treat every response as the authoritative answer.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why 403 is a weak signal
&lt;/h2&gt;

&lt;p&gt;The instinct is to watch for 403 and re-solve on it. That misses most failures:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;PerimeterX frequently answers 200 with a challenge document - the block is in the body, not the status code.&lt;/li&gt;
&lt;li&gt;A rejected cookie is often replaced silently: you get 200, the content you wanted, and a &lt;code&gt;Set-Cookie&lt;/code&gt; that swapped &lt;code&gt;_px3&lt;/code&gt; for a short-lived one. Your next request dies instead of this one.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;_pxvid&lt;/code&gt; and &lt;code&gt;_pxhd&lt;/code&gt; can outlive &lt;code&gt;_px3&lt;/code&gt;. Seeing a valid visitor cookie tells you nothing about whether you may pass.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A robust check looks at three things per response: does the body contain the sensor script or a captcha iframe; did &lt;code&gt;_px3&lt;/code&gt; change in a way that shortens its expiry; and does the same request succeed again from the same IP and UA. Solving on 403 alone is solving one out of three failure modes.&lt;/p&gt;

&lt;h2&gt;
  
  
  The s2s path: no cookie to reuse
&lt;/h2&gt;

&lt;p&gt;Server-to-server deployments move the decision out of the browser. Your backend asks the collector for a verdict, gets a signed token, and attaches it to the request. Three properties matter if you automate against it:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The token is per request. There is no cookie jar to cache, and replaying a used token fails.&lt;/li&gt;
&lt;li&gt;It is bound to the request body and the caller IP, so a token minted for &lt;code&gt;/api/v2/prices&lt;/code&gt; does not authorise &lt;code&gt;/api/v1/checkout&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;There is nothing to "solve" in the browser sense: no image, no sensor, no iframe. If a solver product hands you a cookie for an s2s-protected endpoint, the endpoint is not actually running s2s.&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;Client-side &lt;code&gt;_px3&lt;/code&gt;
&lt;/th&gt;
&lt;th&gt;Server-to-server&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Where the decision happens&lt;/td&gt;
&lt;td&gt;Browser sensor posts to the collector&lt;/td&gt;
&lt;td&gt;Your backend asks the collector&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;What you carry&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;_px3&lt;/code&gt; plus &lt;code&gt;_pxvid&lt;/code&gt; / &lt;code&gt;_pxhd&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;a per-request signed token&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Lifetime&lt;/td&gt;
&lt;td&gt;minutes to hours, tenant-dependent&lt;/td&gt;
&lt;td&gt;one request&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Bound to&lt;/td&gt;
&lt;td&gt;app ID + IP + User-Agent&lt;/td&gt;
&lt;td&gt;app ID + IP + request body&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Poolable across workers&lt;/td&gt;
&lt;td&gt;effectively no&lt;/td&gt;
&lt;td&gt;no&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Typical failure&lt;/td&gt;
&lt;td&gt;silent re-challenge, short TTL&lt;/td&gt;
&lt;td&gt;failed authorisation on every call&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Three failure patterns worth fixing first
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Cookie pools shared across proxies.&lt;/strong&gt; The classic: solve a hundred cookies behind a hundred residential IPs, then round-robin them. Each cookie now runs on the wrong IP, the HMAC no longer matches, and the site answers with a challenge that looks like a rate limit.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Hardcoded TTLs.&lt;/strong&gt; Read the expiry out of the payload, subtract a safety margin, and store that per cookie. Anything else is a guess that silently rots.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Ignoring the returned User-Agent.&lt;/strong&gt; A solver that returns &lt;code&gt;solution.useragent&lt;/code&gt; is telling you which fingerprint the cookie was minted under. Replaying on your own UA is the same mistake as replaying on the wrong IP, and it is invisible in logs because both requests look fine in isolation.&lt;/p&gt;

&lt;p&gt;Here is the correct shape of the loop, using the REST endpoint:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;

&lt;span class="n"&gt;base&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;environ&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"SOLVEHUB_URL"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;rstrip&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"/"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;headers&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="s2"&gt;"Authorization"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="s2"&gt;"Bearer {os.environ['SOLVEHUB_API_KEY']}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s2"&gt;"Idempotency-Key"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"px-refresh-001"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="n"&gt;payload&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="s2"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"perimeterx"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s2"&gt;"task"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="s2"&gt;"websiteURL"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"https://example.com/protected"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s2"&gt;"websiteKey"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"PX_EXAMPLE_APP_ID"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;   &lt;span class="c1"&gt;# pxAppId, not the visitor UUID&lt;/span&gt;
        &lt;span class="s2"&gt;"proxyType"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"http"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s2"&gt;"proxyAddress"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"203.0.113.10"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s2"&gt;"proxyPort"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"8080"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="n"&gt;task_id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="s2"&gt;"{base}/v1/tasks"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;headers&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;timeout&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"taskId"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="kc"&gt;True&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;task&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="s2"&gt;"{base}/v1/tasks/{task_id}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;headers&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;timeout&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;task&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"status"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s2"&gt;"completed"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;cookies&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;task&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"solution"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"cookies"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;      &lt;span class="c1"&gt;# _px3, _pxvid, ...&lt;/span&gt;
        &lt;span class="n"&gt;ua&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;task&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"solution"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"useragent"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;         &lt;span class="c1"&gt;# replay with THIS UA&lt;/span&gt;
        &lt;span class="k"&gt;break&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;task&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"status"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"failed"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"cancelled"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;raise&lt;/span&gt; &lt;span class="nc"&gt;RuntimeError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;task&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"errorCode"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sleep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# The cookie is only valid on the proxy and UA that solved it.&lt;/span&gt;
&lt;span class="n"&gt;session&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Session&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;session&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;cookies&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;update&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;cookies&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;session&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"User-Agent"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ua&lt;/span&gt;
&lt;span class="n"&gt;session&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;proxies&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"http"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"http://203.0.113.10:8080"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"https"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"http://203.0.113.10:8080"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;One trap in that response: &lt;code&gt;solution.value&lt;/code&gt; can come back as an empty string on cookie-style challenges. Judge success on &lt;code&gt;solution.cookies&lt;/code&gt;, not on &lt;code&gt;value&lt;/code&gt; being non-empty - otherwise a perfectly good solve looks like a failure.&lt;/p&gt;

&lt;h2&gt;
  
  
  The rule of thumb
&lt;/h2&gt;

&lt;p&gt;A &lt;code&gt;_px3&lt;/code&gt; is not a credential you own, it is a claim about a session that the server re-evaluates on every request. Cache it with its own expiry, pin it to the IP and UA that minted it, and let the response - not the status code - tell you when it is gone.&lt;/p&gt;

&lt;p&gt;I maintain SolveHub, a CAPTCHA and anti-bot solving API for authorised testing; the PerimeterX endpoint and its request fields are documented at &lt;a href="https://www.tiam.codes/docs/perimeterx" rel="noopener noreferrer"&gt;https://www.tiam.codes/docs/perimeterx&lt;/a&gt;. The shortcuts above are the same ones I had to learn the hard way.&lt;/p&gt;




&lt;p&gt;If you want the reference version of this material — the two-expiry model, the response checks and the s2s distinction, as a page you can cite — it lives in the &lt;a href="https://seencxy.github.io/glossary/px3/" rel="noopener noreferrer"&gt;_px3 cookie glossary entry&lt;/a&gt;. The same set covers &lt;a href="https://seencxy.github.io/glossary/akamai-abck/" rel="noopener noreferrer"&gt;_abck&lt;/a&gt;, &lt;a href="https://seencxy.github.io/glossary/reese84/" rel="noopener noreferrer"&gt;reese84&lt;/a&gt; and &lt;a href="https://seencxy.github.io/glossary/cf-clearance/" rel="noopener noreferrer"&gt;cf_clearance&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>webscraping</category>
      <category>security</category>
      <category>python</category>
    </item>
    <item>
      <title>FunCaptcha (Arkose Labs): why the token is bound to your session — and the three ways people break it</title>
      <dc:creator>Lsr</dc:creator>
      <pubDate>Mon, 09 Nov 2026 15:03:31 +0000</pubDate>
      <link>https://dev.to/seencxy/funcaptcha-arkose-labs-why-the-token-is-bound-to-your-session-and-the-three-ways-people-break-58eh</link>
      <guid>https://dev.to/seencxy/funcaptcha-arkose-labs-why-the-token-is-bound-to-your-session-and-the-three-ways-people-break-58eh</guid>
      <description>&lt;p&gt;FunCaptcha used to be the easy one. You found the public key in the page, you called the endpoint, you got a token, you posted it back. That stopped working around the time Arkose Labs started calling the product "Arkose Bot Manager" and putting an enforcement endpoint in front of every challenge.&lt;/p&gt;

&lt;p&gt;The token is still there. What changed is that the token is no longer a standalone answer to a puzzle — it is the tail end of a session that started before you ever saw a challenge, and every field in it is cross-checked against what the browser actually did.&lt;/p&gt;

&lt;p&gt;This post is about that session, the three ways a solve breaks, and how to read the failure instead of retrying it.&lt;/p&gt;

&lt;h2&gt;
  
  
  What a FunCaptcha solve actually consists of
&lt;/h2&gt;

&lt;p&gt;Three things, in order:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;A public key&lt;/strong&gt; (&lt;code&gt;arkose_labs_...&lt;/code&gt;, or the older UUID form) that identifies the site's Arkose application.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A blob&lt;/strong&gt; — the session state: encrypted risk signals collected from the page, the browser, the network, plus the enforcement decision (pass, challenge, or block). It arrives in the &lt;code&gt;fc-token&lt;/code&gt; blob or from &lt;code&gt;https://client-api.arkoselabs.com/fc/gt2/public_key/&amp;lt;key&amp;gt;&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A token&lt;/strong&gt; — what you get back after the challenge is passed. This is what your target site actually verifies.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The common mistake is to treat step 3 as the whole task. On a plain image captcha, it is. On FunCaptcha, the token is issued &lt;em&gt;against&lt;/em&gt; the blob from step 2, and the target site's backend calls Arkose's verify endpoint with both.&lt;/p&gt;

&lt;h2&gt;
  
  
  The three failure modes, and what each one means
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. &lt;code&gt;ERROR: Invalid token&lt;/code&gt; — the token was solved against a stale blob
&lt;/h3&gt;

&lt;p&gt;The blob has a lifetime measured in minutes and it is bound to a session fingerprint. If you fetch it, wait, then solve, the token comes back valid-looking but the verify call rejects it.&lt;/p&gt;

&lt;p&gt;Fix: treat blob fetch and solve as one operation. If the solve queue is slow, refetch before submitting.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. &lt;code&gt;ERROR: Session mismatch&lt;/code&gt; — the browser that got the blob is not the browser that submits
&lt;/h3&gt;

&lt;p&gt;The blob encodes a device/browser signal set. Submitting the token from a different IP, a different user agent, or a different TLS fingerprint than the one that requested the blob fails the check even when the token itself is perfect.&lt;/p&gt;

&lt;p&gt;Fix: one identity per session, from blob to submit. This is the same rule as DataDome (I wrote about why rotating proxies makes DataDome worse), and it applies here ten times harder because Arkose is a risk engine — a mismatched device is not "low confidence", it is a signal.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. &lt;code&gt;ERROR: Challenge not passed&lt;/code&gt; — the puzzle result was correct but the interaction was not
&lt;/h3&gt;

&lt;p&gt;Arkose scores &lt;em&gt;how&lt;/em&gt; the puzzle was solved: timing, pointer paths, keystroke cadence, whether the image tiles were even looked at. Two answers can be equally correct and score differently.&lt;/p&gt;

&lt;p&gt;Fix: this is the one you cannot paper over in code. Solve with a service that handles the interaction model, or reduce the challenge rate upstream by looking less like a bot before the challenge appears.&lt;/p&gt;

&lt;h2&gt;
  
  
  Reading the payload before you retry
&lt;/h2&gt;

&lt;p&gt;Before blaming the solver, dump what you actually sent:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;

&lt;span class="n"&gt;payload&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;loads&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;blob_raw&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;          &lt;span class="c1"&gt;# what the client-api returned
&lt;/span&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;challenge&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{}).&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;type&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;session&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{}).&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;id&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;data&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{}).&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;blob&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;""&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Symptom&lt;/th&gt;
&lt;th&gt;Likely cause&lt;/th&gt;
&lt;th&gt;What to change&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Token rejected instantly&lt;/td&gt;
&lt;td&gt;Blob expired between fetch and submit&lt;/td&gt;
&lt;td&gt;Fetch, solve, submit in one pass&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Token rejected after the site's own verify&lt;/td&gt;
&lt;td&gt;IP / UA / TLS changed mid-session&lt;/td&gt;
&lt;td&gt;Pin the identity per session&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;challenge not passed&lt;/code&gt; on a correct answer&lt;/td&gt;
&lt;td&gt;Interaction score too low&lt;/td&gt;
&lt;td&gt;Stop scripting the puzzle; change the upstream footprint&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;No challenge at all, straight to block&lt;/td&gt;
&lt;td&gt;Risk score already too high&lt;/td&gt;
&lt;td&gt;The problem is before FunCaptcha, not in it&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The last row is the one people miss. If Arkose returns a hard block instead of a challenge, no solver will help, because there is no challenge to solve. That is a proxy reputation and request-shape problem.&lt;/p&gt;

&lt;h2&gt;
  
  
  A minimal working flow
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;

&lt;span class="n"&gt;API&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;https://api.example-solver.com/v1/tasks&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;   &lt;span class="c1"&gt;# your solver endpoint
&lt;/span&gt;&lt;span class="n"&gt;HEADERS&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Authorization&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Bearer &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;TOKEN&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="n"&gt;task&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;API&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;headers&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;HEADERS&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;type&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;funcaptcha&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;websiteURL&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;target_url&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;websitePublicKey&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;public_key&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;data&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;blob&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;blob_raw&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="p"&gt;}).&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="c1"&gt;# poll
&lt;/span&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt;
&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;60&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;API&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;/&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;task&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;taskId&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;headers&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;HEADERS&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;status&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;ready&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;failed&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;break&lt;/span&gt;
    &lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sleep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;status&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;solution&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{}).&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;token&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two notes that save hours:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Pass the blob as &lt;code&gt;data.blob&lt;/code&gt;, not as a query param on the public key. The verify endpoint compares them.&lt;/li&gt;
&lt;li&gt;Keep the polling interval at 2–5s. Hammering the status endpoint gets you rate-limited by the solver &lt;em&gt;and&lt;/em&gt; by Arkose, and the second one leaves a mark on the session.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why this matters more in 2026
&lt;/h2&gt;

&lt;p&gt;Arkose's enforcement API now runs on a large share of the sites that used to be plain reCAPTCHA — ticketing, gaming logins, account recovery. The challenge itself is a small part of the defence; the session and the risk score around it are the rest. Code that treats "get token" as the interface will keep working on easy sessions and keep failing on the ones you actually care about.&lt;/p&gt;

&lt;p&gt;If you want a reference implementation rather than writing your own, I maintain &lt;a href="https://www.tiam.codes" rel="noopener noreferrer"&gt;SolveHub&lt;/a&gt; (I'm the author) — it takes &lt;code&gt;type: "funcaptcha"&lt;/code&gt; with the same &lt;code&gt;blob&lt;/code&gt; field shape shown above, and bills per completed task rather than per attempt, which matters when you are debugging sessions rather than puzzles.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Next in this series: PerimeterX / HUMAN — the &lt;code&gt;_px3&lt;/code&gt; cookie, and why the payload you send is checked against the page you claim to be on.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>webscraping</category>
      <category>security</category>
      <category>python</category>
    </item>
    <item>
      <title>Imperva's reese84 cookie: what it is, why it dies, and how to reuse it</title>
      <dc:creator>Lsr</dc:creator>
      <pubDate>Mon, 09 Nov 2026 14:45:47 +0000</pubDate>
      <link>https://dev.to/seencxy/impervas-reese84-cookie-what-it-is-why-it-dies-and-how-to-reuse-it-2fe8</link>
      <guid>https://dev.to/seencxy/impervas-reese84-cookie-what-it-is-why-it-dies-and-how-to-reuse-it-2fe8</guid>
      <description>&lt;p&gt;Most write-ups about Imperva (Incapsula) stop at "you need the reese84 cookie". That is the easy half. The hard half is that a &lt;code&gt;reese84&lt;/code&gt; value you obtained five minutes ago, from a different IP, will usually be rejected on the first request — and the error you get back does not tell you why.&lt;/p&gt;

&lt;p&gt;This is a field note on what the cookie actually contains, why replay fails, and what a working solve-and-reuse loop looks like.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the cookie is
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;reese84&lt;/code&gt; is a browser-integrity cookie. It is issued by Imperva's client-side script only after that script has decided the visitor is plausibly human, and it is set on the response that follows a successful challenge. Until you have it, every request to a protected URL returns either the interstitial challenge page or a flat 403.&lt;/p&gt;

&lt;p&gt;Structurally, the value is colon-separated in three parts:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;a &lt;strong&gt;version prefix&lt;/strong&gt;,&lt;/li&gt;
&lt;li&gt;a long &lt;strong&gt;encoded payload&lt;/strong&gt; of environment and browser signals collected by the challenge script,&lt;/li&gt;
&lt;li&gt;a &lt;strong&gt;signature&lt;/strong&gt; that binds the payload to the request that produced it.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The middle part is not a bearer token. It is evidence about a specific session, and Imperva re-scores that evidence on every request rather than trusting it once issued.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why a reese84 from another session fails
&lt;/h2&gt;

&lt;p&gt;Three things get checked against the cookie on replay:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. IP address.&lt;/strong&gt; A cookie minted on one IP and replayed from another is re-scored, often into a challenge. This is the single most common cause of "it worked in the solver, it failed in my scraper".&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. HTTP and TLS fingerprint.&lt;/strong&gt; Header order, HTTP/2 SETTINGS frames, and the TLS ClientHello are compared against what the script observed. A solve performed in a real Chrome and a replay performed by &lt;code&gt;python-requests&lt;/code&gt; are two different fingerprints, and the cookie carries a memory of the first one.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. The paired values from the same run.&lt;/strong&gt; The cookie, the user agent, and the proxy have to come from one solving session. Pair a fresh cookie with a stale user agent string and the mismatch is itself a signal.&lt;/p&gt;

&lt;p&gt;Which is why the reflex of rotating proxies per request makes things worse: each new IP invalidates the cookie you just paid for, you get sent back to the challenge, you solve again, and the loop never converges. Solve on the IP you intend to scrape from, keep that IP for the session, and let the cookie do its job.&lt;/p&gt;

&lt;h2&gt;
  
  
  The two Imperva modes, and the field mix-up that breaks half of all attempts
&lt;/h2&gt;

&lt;p&gt;Most solving APIs expose Imperva as one task type with two modes. Both are the same &lt;code&gt;type&lt;/code&gt;, selected by a flag — and they take &lt;strong&gt;different script fields&lt;/strong&gt;. Getting this wrong is the most common silent failure:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Mode&lt;/th&gt;
&lt;th&gt;Required fields&lt;/th&gt;
&lt;th&gt;Notes&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Reese84&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;websiteURL&lt;/code&gt;, &lt;code&gt;reeseScriptUrl&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;omit &lt;code&gt;isUtmvc&lt;/code&gt;, or set it to &lt;code&gt;false&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;UT.mvc&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;websiteURL&lt;/code&gt;, &lt;code&gt;isUtmvc: true&lt;/code&gt;, &lt;code&gt;scriptURL&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;scriptURL&lt;/code&gt; is the full &lt;code&gt;/_Incapsula_Resource?SWJIYLWA=...&lt;/code&gt; URL&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Both accept optional &lt;code&gt;proxy&lt;/code&gt;, &lt;code&gt;useragent&lt;/code&gt;, &lt;code&gt;language&lt;/code&gt;, and preset &lt;code&gt;cookies&lt;/code&gt; (each item only &lt;code&gt;name&lt;/code&gt; and &lt;code&gt;value&lt;/code&gt;). Use a desktop Chrome/Chromium or Android Chrome user agent — Firefox, Edge, Opera, and iOS browsers are unsupported, and an unsupported family shows up as a failed task rather than a validation error.&lt;/p&gt;

&lt;p&gt;A minimal Reese84 request:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl -sS -X POST &lt;span class="s1"&gt;'https://www.tiam.codes/v1/tasks'&lt;/span&gt; \
  -H &lt;span class="s1"&gt;'Authorization: Bearer YOUR_API_KEY'&lt;/span&gt; \
  -H &lt;span class="s1"&gt;'Content-Type: application/json'&lt;/span&gt; \
  -H &lt;span class="s1"&gt;'Idempotency-Key: reese84-0001'&lt;/span&gt; \
  --data-binary @- &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="s1"&gt;'JSON'&lt;/span&gt;
&lt;span class="o"&gt;{&lt;/span&gt;
  &lt;span class="s2"&gt;"type"&lt;/span&gt;: &lt;span class="s2"&gt;"imperva"&lt;/span&gt;,
  &lt;span class="s2"&gt;"task"&lt;/span&gt;: &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="s2"&gt;"websiteURL"&lt;/span&gt;: &lt;span class="s2"&gt;"https://example.com/protected"&lt;/span&gt;,
    &lt;span class="s2"&gt;"reeseScriptUrl"&lt;/span&gt;: &lt;span class="s2"&gt;"https://example.com/challenge/reese.js"&lt;/span&gt;,
    &lt;span class="s2"&gt;"proxy"&lt;/span&gt;: &lt;span class="s2"&gt;"http://user:pass@203.0.113.10:8080"&lt;/span&gt;,
    &lt;span class="s2"&gt;"useragent"&lt;/span&gt;: &lt;span class="s2"&gt;"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"&lt;/span&gt;
  &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
JSON
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Poll &lt;code&gt;GET /v1/tasks/{taskId}&lt;/code&gt; until the status is &lt;code&gt;completed&lt;/code&gt;, then read &lt;code&gt;cookies&lt;/code&gt; (including &lt;code&gt;reese84&lt;/code&gt;) and &lt;code&gt;useragent&lt;/code&gt; out of the result.&lt;/p&gt;

&lt;p&gt;Two lifecycle details worth knowing before you build retries:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;failed&lt;/code&gt; and &lt;code&gt;cancelled&lt;/code&gt; are terminal and refunded.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;uncertain&lt;/code&gt; is &lt;strong&gt;not&lt;/strong&gt; final. Keep polling the same task id. Creating a new task because the status was ambiguous is how you pay twice for one solve.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Reusing the cookie
&lt;/h2&gt;

&lt;p&gt;Send the cookie with the same proxy and the same user agent that produced it, as one consistent identity per session:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;

&lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Session&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;proxies&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"http"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;PROXY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"https"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;PROXY&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;update&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="s2"&gt;"User-Agent"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;RESULT_USERAGENT&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s2"&gt;"Cookie"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="s2"&gt;"reese84={RESULT_REESE84}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"https://example.com/protected"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two rules that hold up in practice:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;One identity per session.&lt;/strong&gt; Cookie + proxy + user agent travel together for the whole session, not per request.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Reuse, do not re-solve.&lt;/strong&gt; Re-solving per request costs a task each time and resets the trust the previous solve earned. Batch your work under one session while the cookie is warm.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Troubleshooting, by symptom
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Symptom&lt;/th&gt;
&lt;th&gt;Likely cause&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Challenge page again on the very first request&lt;/td&gt;
&lt;td&gt;Wrong mode — UT.mvc site solved as Reese84, or a stale &lt;code&gt;reeseScriptUrl&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Works from the solving API's IP, fails from yours&lt;/td&gt;
&lt;td&gt;Cookie replayed from a different IP than the solve&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;403 with a cookie that looks valid&lt;/td&gt;
&lt;td&gt;TLS/HTTP fingerprint mismatch — your client library, not the cookie&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Task returns &lt;code&gt;failed&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Unsupported user agent family, or the script URL no longer exists on the target&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Intermittent success, no pattern&lt;/td&gt;
&lt;td&gt;Session identity is leaking — one of the three values is rotating&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  A note on scope
&lt;/h2&gt;

&lt;p&gt;Everything above assumes you have permission to test the target: your own site, a client's site under contract, or a target whose terms allow automated access. Integrity cookies exist to tell humans from bots, so reusing one against a site you do not own is the thing the cookie is designed to stop, and it is usually a terms-of-service problem rather than an engineering one. The interesting engineering is on the authorized side, where you want to verify that your own protection actually discriminates — and for that you need a reliable way to produce a solver-side session, not a way to bypass someone else's.&lt;/p&gt;

&lt;p&gt;I work on &lt;a href="https://www.tiam.codes/docs/imperva" rel="noopener noreferrer"&gt;SolveHub&lt;/a&gt;, which is the API used in the examples above; the field tables and error codes are documented there. The diagnosis in this post — IP binding, fingerprint mismatch, mode confusion — applies to any Imperva solver you evaluate, including a self-hosted one.&lt;/p&gt;

&lt;p&gt;If you are debugging a reese84 failure right now, the fastest split is: does the same cookie work on the same IP? If yes, it is your client fingerprint. If no, it is the solve.&lt;/p&gt;




&lt;p&gt;If you want the reference version of this material rather than the walkthrough — the value format, the four bindings that kill the cookie, the 403 triage table and the vendor-identification checks — it lives in the &lt;a href="https://seencxy.github.io/glossary/reese84/" rel="noopener noreferrer"&gt;reese84 cookie glossary entry&lt;/a&gt;, and the same set covers &lt;a href="https://seencxy.github.io/glossary/akamai-abck/" rel="noopener noreferrer"&gt;_abck&lt;/a&gt;, &lt;a href="https://seencxy.github.io/glossary/px3/" rel="noopener noreferrer"&gt;_px3&lt;/a&gt; and &lt;a href="https://seencxy.github.io/glossary/cf-clearance/" rel="noopener noreferrer"&gt;cf_clearance&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>webscraping</category>
      <category>security</category>
      <category>python</category>
    </item>
    <item>
      <title>Eight checks before you buy a CAPTCHA solver: the 403 debugging ladder</title>
      <dc:creator>Lsr</dc:creator>
      <pubDate>Sun, 08 Nov 2026 07:20:52 +0000</pubDate>
      <link>https://dev.to/seencxy/eight-checks-before-you-buy-a-captcha-solver-the-403-debugging-ladder-2d2j</link>
      <guid>https://dev.to/seencxy/eight-checks-before-you-buy-a-captcha-solver-the-403-debugging-ladder-2d2j</guid>
      <description>&lt;p&gt;You have a 403. The internet has two answers ready: buy a proxy, or buy a CAPTCHA solver. Both are right maybe half the time, and the wrong one costs you a month of engineering before you notice.&lt;/p&gt;

&lt;p&gt;This is the ladder I run before spending money on either. Each step is cheaper than the one below it, and most 403s stop at step 2.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Read the response, do not guess what blocked you
&lt;/h2&gt;

&lt;p&gt;A 403 from a WAF and a 403 from an application login check look identical in your exception handler and completely different in the headers:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-sS&lt;/span&gt; &lt;span class="nt"&gt;-D&lt;/span&gt; - &lt;span class="nt"&gt;-o&lt;/span&gt; /dev/null &lt;span class="s1"&gt;'https://target.example/page'&lt;/span&gt; | &lt;span class="nb"&gt;head&lt;/span&gt; &lt;span class="nt"&gt;-40&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;cf-ray&lt;/code&gt; plus &lt;code&gt;cf-mitigated: challenge&lt;/code&gt; — Cloudflare is challenging you, not the app.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;x-datadome&lt;/code&gt; or a &lt;code&gt;datadome&lt;/code&gt; cookie — DataDome.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;_abck&lt;/code&gt; or &lt;code&gt;bm_sz&lt;/code&gt; — Akamai Bot Manager.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;_px3&lt;/code&gt; or &lt;code&gt;_pxhd&lt;/code&gt; — PerimeterX / HUMAN.&lt;/li&gt;
&lt;li&gt;A 200 whose body is 2 KB of JavaScript and no content — that is a challenge page, not a success.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That single distinction decides the next seven steps. If the body is the real page and the app says no, no amount of solving will help you.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Is it the environment or the IP?
&lt;/h2&gt;

&lt;p&gt;Run the same request from a different network — your laptop on home broadband is enough.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Works from home, fails from the datacenter: it is IP reputation, and a proxy is the right purchase.&lt;/li&gt;
&lt;li&gt;Fails from both: it is you (fingerprint, headers, cookies) or it is the account. A proxy will only make it worse and more expensive.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  3. Real browser or headless?
&lt;/h2&gt;

&lt;p&gt;If a normal browser loads the page and Playwright does not, the difference is TLS/JA4, HTTP/2 settings or header order — not your IP, and not something a solver fixes. Compare your client fingerprint against the browser with any JA3/JA4 checker before spending on either.&lt;/p&gt;

&lt;p&gt;Two reliable fixes here: run a real browser build with matching versions, or use a client that reproduces the browser fingerprint. Rotating proxies at this stage is the classic mistake — five hundred IPs behind one headless fingerprint is one user with five hundred hats.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. If a token is required, which token?
&lt;/h2&gt;

&lt;p&gt;Solver APIs are not interchangeable. A Turnstile token is useless on an Akamai page, and a &lt;code&gt;datadome&lt;/code&gt; cookie is not a token at all — it is a session credential bound to the IP and User-Agent that received it. Identify the challenge from step 1, then ask for that specific thing.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Challenge&lt;/th&gt;
&lt;th&gt;How you recognise it&lt;/th&gt;
&lt;th&gt;Price per 1,000 solved&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Cloudflare Turnstile&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;cf-turnstile&lt;/code&gt; widget, &lt;code&gt;0x4AAA...&lt;/code&gt; sitekey&lt;/td&gt;
&lt;td&gt;from $0.20&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Cloudflare Interstitial&lt;/td&gt;
&lt;td&gt;full-page check, no widget to click&lt;/td&gt;
&lt;td&gt;$0.40&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Akamai Bot Manager&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;_abck&lt;/code&gt;, &lt;code&gt;bm_sz&lt;/code&gt; cookies&lt;/td&gt;
&lt;td&gt;$0.80&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;PerimeterX / HUMAN&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;_px3&lt;/code&gt; cookie, &lt;code&gt;px-captcha&lt;/code&gt; frame&lt;/td&gt;
&lt;td&gt;$1.00&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AWS WAF&lt;/td&gt;
&lt;td&gt;&lt;code&gt;aws-waf-token&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;$1.00&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;DataDome&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;x-datadome&lt;/code&gt; header, &lt;code&gt;datadome&lt;/code&gt; cookie&lt;/td&gt;
&lt;td&gt;$1.20&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Imperva&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;incap_ses_&lt;/code&gt;, &lt;code&gt;visid_incap_&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;$1.60&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Arkose FunCaptcha&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;arkoselabs&lt;/code&gt; script, &lt;code&gt;funcaptcha&lt;/code&gt; frame&lt;/td&gt;
&lt;td&gt;$2.00&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Prices above are from one vendor — mine, see the note at the bottom — and they are there to make the point that the spread is 10x. Paying FunCaptcha money for a Turnstile page is a silent 10x overrun.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Are you submitting the token correctly?
&lt;/h2&gt;

&lt;p&gt;This is the most common self-inflicted 403, and it looks exactly like a solver that does not work:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;sitekey and page must match.&lt;/strong&gt; A token minted for &lt;code&gt;example.com/login&lt;/code&gt; will not validate on &lt;code&gt;example.com/checkout&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;action&lt;/code&gt; and &lt;code&gt;cdata&lt;/code&gt; must be carried over.&lt;/strong&gt; If the page passes them, the token has to be minted with the same values.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tokens are single-use and short-lived.&lt;/strong&gt; Turnstile tokens are valid for about 300 seconds and one submission.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Post the field name the page expects.&lt;/strong&gt; &lt;code&gt;cf-turnstile-response&lt;/code&gt;, &lt;code&gt;g-recaptcha-response&lt;/code&gt;, &lt;code&gt;h-captcha-response&lt;/code&gt; — three different names, one wrong guess sends you back to the challenge.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  6. For cookie challenges, identity must not move
&lt;/h2&gt;

&lt;p&gt;DataDome, Akamai, PerimeterX, Imperva and AWS WAF hand you a cookie that is bound to the IP and User-Agent that earned it. Reusing it from a different proxy exit fails instantly, and the failure looks like the solver produced a bad value.&lt;/p&gt;

&lt;p&gt;Rule: one identity per session — same proxy, same User-Agent, same cookie jar. Rotate identities between sessions, never inside one.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. Check your own traffic shape before blaming the target
&lt;/h2&gt;

&lt;p&gt;A scraper that opens 40 parallel requests against one host gets challenged regardless of how clean the requests are. Concurrency of 4 to 8 per host, a small delay, and reusing a session for a whole crawl will outperform any fingerprint trick. If your logs show a challenge on the first request every time, this is not a capacity problem — go back to step 3.&lt;/p&gt;

&lt;h2&gt;
  
  
  8. Do the unit economics on accepted answers, not attempts
&lt;/h2&gt;

&lt;p&gt;This is the step almost nobody does, and it changes which vendor wins. If you pay per solved task, failed solves are free, so your real cost is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cost per accepted answer = price per solved task / acceptance rate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A $0.20 solve that the site rejects adds a retry, a new session and possibly a raised risk score. Two retries at $0.20 plus a session reset can cost more than one $1.20 solve that lands first time. Price per 1,000 is a starting point; cost per accepted answer is the number that shows up in your invoice.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where a solver actually fits
&lt;/h2&gt;

&lt;p&gt;If steps 1 to 7 leave you with a page that is blocked purely because it wants a token or cookie you cannot produce headlessly, that is the moment to buy solving capacity — and to buy it by challenge type, not by volume. I run &lt;a href="https://tiam.codes" rel="noopener noreferrer"&gt;SolveHub&lt;/a&gt;, one REST endpoint for the eight challenge types in the table above, billed only on completed tasks, with the cookie challenges accepting your own proxy so the credential comes back usable.&lt;/p&gt;

&lt;p&gt;Client code, if you want it: &lt;a href="https://github.com/seencxy/solvehub-python" rel="noopener noreferrer"&gt;solvehub-python&lt;/a&gt; (stdlib only) and &lt;a href="https://github.com/seencxy/solvehub-node" rel="noopener noreferrer"&gt;solvehub-node&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The two earlier posts in this series go deeper on the two most common cases: &lt;a href="https://dev.to/seencxy/cloudflare-turnstile-in-a-python-scraper-tokens-expiry-and-three-approaches-5592"&gt;Turnstile tokens and expiry&lt;/a&gt; and &lt;a href="https://dev.to/seencxy/datadome-in-playwright-why-rotating-your-proxy-makes-blocking-worse-2259"&gt;why rotating proxies makes DataDome worse&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Disclosure: I build the solver API linked above. Everything in steps 1 to 7 applies whether you buy from me or from nobody.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Use only on systems you own or are authorised to test.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>webscraping</category>
      <category>python</category>
      <category>security</category>
      <category>programming</category>
    </item>
    <item>
      <title>DataDome in Playwright: why rotating your proxy makes blocking worse</title>
      <dc:creator>Lsr</dc:creator>
      <pubDate>Sun, 08 Nov 2026 07:10:18 +0000</pubDate>
      <link>https://dev.to/seencxy/datadome-in-playwright-why-rotating-your-proxy-makes-blocking-worse-2259</link>
      <guid>https://dev.to/seencxy/datadome-in-playwright-why-rotating-your-proxy-makes-blocking-worse-2259</guid>
      <description>&lt;p&gt;You add a proxy pool. You rotate it every request. The blocks get &lt;em&gt;more&lt;/em&gt; frequent, not less. Then you read that DataDome needs "better residential IPs", you buy a bigger pool, and the block rate climbs again.&lt;/p&gt;

&lt;p&gt;I have spent a lot of time on this failure mode. The short version: &lt;strong&gt;rotation is not a mitigation for DataDome, it is an accelerator.&lt;/strong&gt; Here is the mechanism, and the two approaches that actually hold up.&lt;/p&gt;

&lt;h2&gt;
  
  
  What DataDome is actually scoring
&lt;/h2&gt;

&lt;p&gt;A CAPTCHA from DataDome is the visible output of a score computed &lt;em&gt;before&lt;/em&gt; it, from signals that mostly have nothing to do with your IP:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;TLS fingerprint (JA3/JA4)&lt;/strong&gt; and &lt;strong&gt;HTTP/2 fingerprint&lt;/strong&gt; — cipher order, extensions, SETTINGS frame, header order. Your proxy changes none of these. A real Chrome does.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Navigator and environment consistency&lt;/strong&gt; — &lt;code&gt;userAgent&lt;/code&gt;, &lt;code&gt;platform&lt;/code&gt;, &lt;code&gt;hardwareConcurrency&lt;/code&gt;, &lt;code&gt;deviceMemory&lt;/code&gt;, WebGL renderer string, canvas hash, fonts, audio context.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Coherence between identity and network&lt;/strong&gt; — a &lt;code&gt;Europe/Paris&lt;/code&gt; timezone and &lt;code&gt;fr-FR&lt;/code&gt; locale on an IP geolocated to a datacenter in Virginia is a signal on its own.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Behaviour before the challenge&lt;/strong&gt; — mouse movement, scroll, keystroke timing, request cadence.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now consider a pool of 500 IPs all driven by one headless browser build. From DataDome's side, that is not 500 users. It is &lt;strong&gt;one fingerprint wearing 500 hats&lt;/strong&gt;, and it gets scored accordingly. A stable IP with a consistent, plausible fingerprint is usually &lt;em&gt;safer&lt;/em&gt; than a fresh IP every request.&lt;/p&gt;

&lt;h2&gt;
  
  
  The cookie is not portable
&lt;/h2&gt;

&lt;p&gt;When DataDome does let you through, it drops a &lt;code&gt;datadome&lt;/code&gt; cookie. That cookie is bound to the identity that earned it — the IP it was issued to, the User-Agent sent with it, the TLS fingerprint of the client that used it.&lt;/p&gt;

&lt;p&gt;So:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Symptom&lt;/th&gt;
&lt;th&gt;What it usually means&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Cookie works, then dies when you rotate&lt;/td&gt;
&lt;td&gt;Cookie is bound to the original egress IP&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Cookie dies only after you restart the browser&lt;/td&gt;
&lt;td&gt;Bound to the fingerprint / session, not just IP&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Every request returns the interstitial, instantly&lt;/td&gt;
&lt;td&gt;Score already high from fingerprint reuse across many IPs&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Works in curl, blocked in Playwright&lt;/td&gt;
&lt;td&gt;Header order, HTTP/2 fingerprint, or missing browser-only headers&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Works locally, blocked on the server&lt;/td&gt;
&lt;td&gt;Timezone/locale vs IP mismatch, or a datacenter ASN&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;If you fix only the IP, you fix the symptom in row 1 and make rows 3 and 5 worse.&lt;/p&gt;

&lt;h2&gt;
  
  
  Approach 1 — one stable identity per worker
&lt;/h2&gt;

&lt;p&gt;Instead of rotating, give each worker &lt;strong&gt;its own long-lived identity&lt;/strong&gt; and never rotate mid-session:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;One persistent browser context per worker (&lt;code&gt;launch_persistent_context&lt;/code&gt;), so cookies and storage survive between pages.&lt;/li&gt;
&lt;li&gt;One sticky proxy per worker for the life of that context — not per request.&lt;/li&gt;
&lt;li&gt;Warm the session on a benign page first so there is real navigation history and interaction telemetry before you hit the protected URL.&lt;/li&gt;
&lt;li&gt;Keep the browser build patched and consistent with the UA string you report.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is slower to set up and uses more memory, which is exactly why rotation is popular — but it is the only shape that survives a persistent score.&lt;/p&gt;

&lt;h2&gt;
  
  
  Approach 2 — solve the interstitial out of band, reuse the cookie
&lt;/h2&gt;

&lt;p&gt;If you do not need a full browser on every request, you can let a solver earn the cookie once and then replay it from your normal HTTP client. You submit the protected URL and the challenge URL, and get back the cookie plus the User-Agent that was used to obtain it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;solvehub&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;SolveHub&lt;/span&gt;

&lt;span class="n"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;SolveHub&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;sh_live_xxx&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;task&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;solve&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;datadome&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;websiteURL&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;https://example.com&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;captchaUrl&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;https://example.com/captcha&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="n"&gt;proxy&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;http://user:pass@host:port&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;   &lt;span class="c1"&gt;# the egress IP the cookie will be bound to
&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;cookies&lt;/span&gt;    &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;task&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;solution&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;cookies&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;      &lt;span class="c1"&gt;# {"datadome": "..."}
&lt;/span&gt;&lt;span class="n"&gt;user_agent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;task&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;solution&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;userAgent&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then the part everyone gets wrong:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;session&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Session&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;session&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;User-Agent&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;user_agent&lt;/span&gt;        &lt;span class="c1"&gt;# must match, verbatim
&lt;/span&gt;&lt;span class="n"&gt;session&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;cookies&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;update&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;cookies&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;                   &lt;span class="c1"&gt;# same cookie domain
&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;session&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;https://example.com/target&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;     &lt;span class="c1"&gt;# from the SAME egress IP
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Three rules that decide whether this works:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Same egress IP.&lt;/strong&gt; The cookie was issued to one IP. Sending it from another is what makes people conclude "the solver does not work".&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Byte-identical User-Agent.&lt;/strong&gt; Not the same &lt;em&gt;family&lt;/em&gt; — the same string, including the Chrome build suffix.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Re-solve when it expires.&lt;/strong&gt; These cookies are short-lived by design. Cache per identity with a TTL, not forever.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Which one to choose
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Full browser automation with JS-heavy pages and interactive flows: &lt;strong&gt;Approach 1&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;High-volume read paths, or when Playwright is too expensive per request: &lt;strong&gt;Approach 2&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Both together: persist the context for navigation, refresh the cookie out of band when the score degrades.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The one change that helps in every case is to stop treating IP rotation as the answer. Fix the fingerprint, keep identities stable, and rotate &lt;em&gt;identities&lt;/em&gt; — not IPs on a single identity.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Disclosure: I build &lt;a href="https://www.tiam.codes" rel="noopener noreferrer"&gt;SolveHub&lt;/a&gt;, a CAPTCHA API that handles DataDome, Cloudflare Turnstile and Interstitial, Akamai, PerimeterX, Imperva, AWS WAF, Arkose FunCaptcha and image OCR through a single endpoint. Use it only against systems you own or are authorized to test.&lt;/em&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  Related in this series
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Turnstile tokens and expiry in Python: &lt;a href="https://dev.to/seencxy/cloudflare-turnstile-in-a-python-scraper-tokens-expiry-and-three-approaches-5592"&gt;seencxy/cloudflare-turnstile-in-a-python-scraper-tokens-expiry-and-three-approaches-5592&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Runnable client code: &lt;a href="https://github.com/seencxy/solvehub-python" rel="noopener noreferrer"&gt;solvehub-python&lt;/a&gt; · &lt;a href="https://github.com/seencxy/solvehub-node" rel="noopener noreferrer"&gt;solvehub-node&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>python</category>
      <category>webscraping</category>
      <category>security</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Cloudflare Turnstile in a Python scraper: tokens, expiry, and three approaches</title>
      <dc:creator>Lsr</dc:creator>
      <pubDate>Sun, 08 Nov 2026 07:03:56 +0000</pubDate>
      <link>https://dev.to/seencxy/cloudflare-turnstile-in-a-python-scraper-tokens-expiry-and-three-approaches-5592</link>
      <guid>https://dev.to/seencxy/cloudflare-turnstile-in-a-python-scraper-tokens-expiry-and-three-approaches-5592</guid>
      <description>&lt;p&gt;If you scrape a site that sits behind Cloudflare Turnstile, you have probably seen the same loop: the page loads, a small widget renders, and every request without a valid token comes back as a 403 with a challenge page.&lt;/p&gt;

&lt;p&gt;This post is about the mechanics of that token — where it comes from, how long it lives, why a "working" solver still gives you 403s — and the three approaches that actually work.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Turnstile actually gives you
&lt;/h2&gt;

&lt;p&gt;Turnstile replaces the old image CAPTCHA with an invisible check that combines proof-of-work with a JavaScript fingerprint. When it succeeds, the widget hands your page a token: a long opaque string. You submit that token with your form (usually in a hidden field, sometimes in a header), and Cloudflare's edge validates it.&lt;/p&gt;

&lt;p&gt;Three properties matter more than anything else:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;The token is bound to the sitekey and the hostname.&lt;/strong&gt; A token minted for &lt;code&gt;example.com&lt;/code&gt; will not validate on &lt;code&gt;www.example.com&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;It expires in 300 seconds.&lt;/strong&gt; Turnstile tokens live for five minutes, and each one is single-use.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Optional fields are part of the signature.&lt;/strong&gt; If the page passes &lt;code&gt;action&lt;/code&gt; or &lt;code&gt;cdata&lt;/code&gt; to &lt;code&gt;turnstile.render&lt;/code&gt;, your solution has to carry the same values or validation fails with no useful error message.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Most "the solver doesn't work" reports are one of those three.&lt;/p&gt;

&lt;h2&gt;
  
  
  Approach 1: drive a real browser
&lt;/h2&gt;

&lt;p&gt;At low volume, Playwright (or Patchright, if you want the patched CDP layer) with a persistent profile is usually enough — the widget runs its check in a real JS environment and you simply read the token out of the DOM.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;playwright.sync_api&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;sync_playwright&lt;/span&gt;

&lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="nf"&gt;sync_playwright&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;browser&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;chromium&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;launch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="n"&gt;headless&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;False&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;--disable-blink-features=AutomationControlled&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;ctx&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;browser&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;new_context&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;storage_state&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;state.json&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;page&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;new_page&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="n"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;goto&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;https://example.com/login&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="n"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;wait_for_function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;() =&amp;gt; document.querySelector(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;[name=cf-turnstile-response]&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;)?.value&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;token&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;eval_on_selector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;[name=cf-turnstile-response]&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;el =&amp;gt; el.value&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The costs are real: a browser process per concurrency slot, 100–300 MB RSS each, and it breaks whenever the fingerprint check gets stricter. Fine for a handful of pages an hour, painful at thousands.&lt;/p&gt;

&lt;h2&gt;
  
  
  Approach 2: outsource the token
&lt;/h2&gt;

&lt;p&gt;The second option keeps your scraper on plain HTTP and lets a service produce the token. &lt;a href="https://tiam.codes" rel="noopener noreferrer"&gt;SolveHub&lt;/a&gt; (disclosure: I build it) is one; CapSolver, 2Captcha and YesCaptcha work the same way. The shape is identical everywhere: create a task with the sitekey and page URL, poll until it completes, read the token.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;solvehub&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;SolveHub&lt;/span&gt;

&lt;span class="n"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;SolveHub&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;sh_live_xxx&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;task&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;solve&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;turnstile&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;websiteURL&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;https://example.com/login&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;websiteKey&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;0x4AAAAAAA_SITE_KEY&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;action&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;login&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;          &lt;span class="c1"&gt;# only if the page sets one
&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="n"&gt;token&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;task&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;solution&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;value&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then post that token back to the page inside its five-minute window, from the same IP and User-Agent that fetched the page.&lt;/p&gt;

&lt;p&gt;Two things break this in practice. First, free proxies: a token solved on a residential IP and replayed from a datacenter IP gets rejected. Second, queue latency — if your job sits in a queue for six minutes, the token is already dead.&lt;/p&gt;

&lt;p&gt;For cookie-based challenges (DataDome, Akamai, PerimeterX, Imperva, AWS WAF) there is no token at all. You get cookies back, and those cookies are tied to the IP and User-Agent that solved them. Reuse all three together or the next request is challenged again.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;task&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;solve&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;datadome&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;websiteURL&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;https://example.com&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;captchaUrl&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;https://example.com/captcha&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="n"&gt;proxy&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;http://user:pass@host:port&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;cookies&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;task&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;solution&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;cookies&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;       &lt;span class="c1"&gt;# {"datadome": "..."}
&lt;/span&gt;&lt;span class="n"&gt;user_agent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;task&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;solution&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;userAgent&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Approach 3: don't fight the edge
&lt;/h2&gt;

&lt;p&gt;Worth saying out loud: some sites publish exactly the data you want through an official API, a feed or a sitemap. If a product has a documented endpoint, use it — it is faster, stable, and nobody has to reverse-engineer anything. Only reach for the previous two approaches when there is genuinely no supported path.&lt;/p&gt;

&lt;h2&gt;
  
  
  A five-line checklist for 403s
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Symptom&lt;/th&gt;
&lt;th&gt;Usual cause&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;403 after submitting a token&lt;/td&gt;
&lt;td&gt;token expired or already used&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;403 with a fresh token&lt;/td&gt;
&lt;td&gt;hostname / sitekey mismatch, or &lt;code&gt;action&lt;/code&gt; + &lt;code&gt;cdata&lt;/code&gt; not carried over&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Works locally, fails in production&lt;/td&gt;
&lt;td&gt;different egress IP than the one that solved it&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Challenge on every single request&lt;/td&gt;
&lt;td&gt;cookies not persisted between requests&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Works for a while, then stops&lt;/td&gt;
&lt;td&gt;fingerprint change, or your UA rotating mid-session&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Legal note
&lt;/h2&gt;

&lt;p&gt;Everything above is for systems you own or have written permission to test. Solving a third party's anti-bot challenge can violate their terms of service, and Cloudflare itself treats automated solving as an attack signal. Get permission first, and put it in writing.&lt;/p&gt;




&lt;h3&gt;
  
  
  Related in this series
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Why rotating proxies makes DataDome blocking worse: &lt;a href="https://dev.to/seencxy/datadome-in-playwright-why-rotating-your-proxy-makes-blocking-worse-2259"&gt;seencxy/datadome-in-playwright-why-rotating-your-proxy-makes-blocking-worse-2259&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Runnable client code: &lt;a href="https://github.com/seencxy/solvehub-python" rel="noopener noreferrer"&gt;solvehub-python&lt;/a&gt; · &lt;a href="https://github.com/seencxy/solvehub-node" rel="noopener noreferrer"&gt;solvehub-node&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>python</category>
      <category>webdev</category>
      <category>security</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
