Skip to content

🕷️ The BEST Web Scraping framework that handles everything from a single request to a full-scale crawl! Don't be shy, join here: https://discord.gg/EMgGbDceNQ and follow here for daily tips and tricks: https://x.com/Scrapling_dev

fix: update the cookies type hint for the mcp server

Karim shoair1b838eabd0b2
diff --git a/scrapling/core/ai.py b/scrapling/core/ai.py
index ec061f5..794f9a7 100644
--- a/scrapling/core/ai.py
+++ b/scrapling/core/ai.py
@@ -17,13 +17,15 @@ from scrapling.fetchers import (
from scrapling.core._types import (
Optional,
Tuple,
- extraction_types,
Mapping,
Dict,
List,
Any,
- SelectorWaitStates,
Generator,
+ Sequence,
+ SetCookieParam,
+ extraction_types,
+ SelectorWaitStates,
)
@@ -224,7 +226,7 @@ class ScraplingMCPServer:
timeout: int | float = 30000,
disable_resources: bool = False,
wait_selector: Optional[str] = None,
- cookies: Optional[List[Dict]] = None,
+ cookies: Sequence[SetCookieParam] | None = None,
network_idle: bool = False,
wait_selector_state: SelectorWaitStates = "attached",
) -> ResponseModel:
@@ -307,7 +309,7 @@ class ScraplingMCPServer:
timeout: int | float = 30000,
disable_resources: bool = False,
wait_selector: Optional[str] = None,
- cookies: Optional[List[Dict]] = None,
+ cookies: Sequence[SetCookieParam] | None = None,
network_idle: bool = False,
wait_selector_state: SelectorWaitStates = "attached",
) -> List[ResponseModel]:
@@ -396,7 +398,7 @@ class ScraplingMCPServer:
timeout: int | float = 30000,
disable_resources: bool = False,
wait_selector: Optional[str] = None,
- cookies: Optional[List[Dict]] = None,
+ cookies: Sequence[SetCookieParam] | None = None,
network_idle: bool = False,
wait_selector_state: SelectorWaitStates = "attached",
block_webrtc: bool = False,
@@ -494,7 +496,7 @@ class ScraplingMCPServer:
timeout: int | float = 30000,
disable_resources: bool = False,
wait_selector: Optional[str] = None,
- cookies: Optional[List[Dict]] = None,
+ cookies: Sequence[SetCookieParam] | None = None,
network_idle: bool = False,
wait_selector_state: SelectorWaitStates = "attached",
block_webrtc: bool = False,
diff --git a/scrapling/engines/_browsers/_types.py b/scrapling/engines/_browsers/_types.py
index 07cb90a..cb8d760 100644
--- a/scrapling/engines/_browsers/_types.py
+++ b/scrapling/engines/_browsers/_types.py
@@ -62,7 +62,7 @@ if TYPE_CHECKING: # pragma: no cover
load_dom: bool
wait_selector: Optional[str]
wait_selector_state: SelectorWaitStates
- cookies: Sequence[SetCookieParam]
+ cookies: Sequence[SetCookieParam] | None
google_search: bool
wait: int | float
timezone_id: str | None