22
33from __future__ import annotations
44
5- from typing import Dict
5+ from typing import Dict , Optional
66from typing_extensions import Literal , Required , Annotated , TypedDict
77
88from .._types import SequenceNotStr
@@ -232,7 +232,15 @@ class WebWebScrapeBytesParams(TypedDict, total=False):
232232 Send as a JSON object or deep-object query params such as
233233 headers[Referer]=https://example.com/. Host, Content-Length, and hop-by-hop
234234 transport headers are rejected. Authorization and cookies are removed when a
235- redirect changes origin.
235+ redirect changes origin. Credential-bearing headers bypass cache reads and
236+ writes; other headers are included in the cache key.
237+ """
238+
239+ max_age_ms : Annotated [Optional [int ], PropertyInfo (alias = "maxAgeMs" )]
240+ """
241+ Return a cached result if a prior scrape for the same parameters exists and is
242+ younger than this many milliseconds. Defaults to 1 day (86400000 ms) when
243+ omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh.
236244 """
237245
238246 tags : SequenceNotStr [str ]
@@ -248,6 +256,16 @@ class WebWebScrapeBytesParams(TypedDict, total=False):
248256 or a JSON-encoded timeoutOpts object.
249257 """
250258
259+ wait_for_ms : Annotated [Optional [int ], PropertyInfo (alias = "waitForMs" )]
260+ """
261+ Optional browser wait time after initial page load, in milliseconds (0–30000; 0
262+ uses 500). When supplied, HTML is rendered with JavaScript and returned as UTF-8
263+ bytes. Other resources keep their original bytes without a browser wait. Omit to
264+ download the original HTTP response. When combined with timeoutOpts,
265+ timeoutOpts.milliseconds must be at least waitForMs + 10000 ms; a shorter
266+ deadline is rejected with 400 TIMEOUT_TOO_SHORT_FOR_WAIT.
267+ """
268+
251269 zdr : Literal ["enabled" , "disabled" ]
252270 """
253271 Set to enabled to bypass shared caches and omit request and response content
0 commit comments