feat(fetcher): Make impersonate able to randomize fingerprint

This commit is contained in:
Karim shoair
2025-11-16 16:33:58 +02:00
parent aa245159d0
commit 3565f9d500
3 changed files with 61 additions and 25 deletions
+3 -5
View File
@@ -5,6 +5,7 @@ from pydantic import BaseModel, Field
from scrapling.core.shell import Convertor
from scrapling.engines.toolbelt.custom import Response as _ScraplingResponse
from scrapling.engines.static import ImpersonateType
from scrapling.fetchers import (
Fetcher,
FetcherSession,
@@ -24,9 +25,6 @@ from scrapling.core._types import (
SelectorWaitStates,
Generator,
)
from curl_cffi.requests import (
BrowserTypeLiteral,
)
class ResponseModel(BaseModel):
@@ -46,7 +44,7 @@ class ScraplingMCPServer:
@staticmethod
def get(
url: str,
impersonate: Optional[BrowserTypeLiteral] = "chrome",
impersonate: ImpersonateType = "chrome",
extraction_type: extraction_types = "markdown",
css_selector: Optional[str] = None,
main_content_only: bool = True,
@@ -124,7 +122,7 @@ class ScraplingMCPServer:
@staticmethod
async def bulk_get(
urls: Tuple[str, ...],
impersonate: Optional[BrowserTypeLiteral] = "chrome",
impersonate: ImpersonateType = "chrome",
extraction_type: extraction_types = "markdown",
css_selector: Optional[str] = None,
main_content_only: bool = True,