88from .._types import SequenceNotStr
99from .._utils import PropertyInfo
1010
11- __all__ = ["WebExtractParams" , "Action" , "ActionWebScrapeWaitAction" , "ActionWebScrapePerformAction" , "Pdf" ]
11+ __all__ = [
12+ "WebExtractParams" ,
13+ "Action" ,
14+ "ActionWebScrapeWaitAction" ,
15+ "ActionWebScrapePerformAction" ,
16+ "ActionWebScrapeScrollAction" ,
17+ "Pdf" ,
18+ ]
1219
1320
1421class WebExtractParams (TypedDict , total = False ):
@@ -29,9 +36,10 @@ class WebExtractParams(TypedDict, total=False):
2936
3037 actions : Iterable [Action ]
3138 """
32- Optional browser actions executed in order on the requested page after it loads
33- and before extraction. Requires a paid plan. When actions are provided and
34- stopAfterMs is omitted, the crawl budget defaults to 110000 ms.
39+ Optional browser actions executed in order on the requested page after it loads,
40+ before links are discovered or additional pages are crawled. Requires a paid
41+ plan. When actions are provided and stopAfterMs is omitted, the crawl budget
42+ defaults to 110000 ms.
3543 """
3644
3745 fact_check : Annotated [bool , PropertyInfo (alias = "factCheck" )]
@@ -120,7 +128,33 @@ class ActionWebScrapePerformAction(TypedDict, total=False):
120128 do : Required [Literal ["perform" ]]
121129
122130
123- Action : TypeAlias = Union [ActionWebScrapeWaitAction , ActionWebScrapePerformAction ]
131+ class ActionWebScrapeScrollAction (TypedDict , total = False ):
132+ """
133+ Scroll the page or a selected scrollable container, waiting adaptively for content and dimensions to settle after each iteration.
134+ """
135+
136+ do : Required [Literal ["scroll" ]]
137+
138+ amount : Union [int , Literal ["viewport" , "max" ]]
139+ """Pixels per scroll, one visible viewport, or the current scroll boundary.
140+
141+ Defaults to viewport.
142+ """
143+
144+ container : str
145+ """CSS selector for the first matching scroll container. Defaults to the page."""
146+
147+ direction : Literal ["up" , "down" , "left" , "right" ]
148+ """Direction to scroll. Defaults to down."""
149+
150+ max_scrolls : Annotated [int , PropertyInfo (alias = "maxScrolls" )]
151+ """Maximum scroll iterations.
152+
153+ Stops early when scrolling and scrollable extent stop changing. Defaults to 1.
154+ """
155+
156+
157+ Action : TypeAlias = Union [ActionWebScrapeWaitAction , ActionWebScrapePerformAction , ActionWebScrapeScrollAction ]
124158
125159
126160class Pdf (TypedDict , total = False ):
0 commit comments