@@ -19,7 +19,17 @@ _LAZY_IMPORTS = {
|
||||
"AsyncStealthySession": ("scrapling.fetchers.firefox", "AsyncStealthySession"),
|
||||
}
|
||||
|
||||
__all__ = ["Fetcher", "AsyncFetcher", "StealthyFetcher", "DynamicFetcher"]
|
||||
__all__ = [
|
||||
"Fetcher",
|
||||
"AsyncFetcher",
|
||||
"FetcherSession",
|
||||
"DynamicFetcher",
|
||||
"DynamicSession",
|
||||
"AsyncDynamicSession",
|
||||
"StealthyFetcher",
|
||||
"StealthySession",
|
||||
"AsyncStealthySession",
|
||||
]
|
||||
|
||||
|
||||
def __getattr__(name: str) -> Any:
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
from scrapling.core._types import (
|
||||
Callable,
|
||||
Dict,
|
||||
List,
|
||||
Dict,
|
||||
Optional,
|
||||
SelectorWaitStates,
|
||||
Iterable,
|
||||
)
|
||||
from scrapling.engines.toolbelt.custom import BaseFetcher, Response
|
||||
from scrapling.engines._browsers._controllers import DynamicSession, AsyncDynamicSession
|
||||
@@ -47,7 +46,7 @@ class DynamicFetcher(BaseFetcher):
|
||||
disable_resources: bool = False,
|
||||
wait_selector: Optional[str] = None,
|
||||
init_script: Optional[str] = None,
|
||||
cookies: Optional[Iterable[Dict]] = None,
|
||||
cookies: Optional[List[Dict]] = None,
|
||||
network_idle: bool = False,
|
||||
load_dom: bool = True,
|
||||
wait_selector_state: SelectorWaitStates = "attached",
|
||||
@@ -134,7 +133,7 @@ class DynamicFetcher(BaseFetcher):
|
||||
disable_resources: bool = False,
|
||||
wait_selector: Optional[str] = None,
|
||||
init_script: Optional[str] = None,
|
||||
cookies: Optional[Iterable[Dict]] = None,
|
||||
cookies: Optional[List[Dict]] = None,
|
||||
network_idle: bool = False,
|
||||
load_dom: bool = True,
|
||||
wait_selector_state: SelectorWaitStates = "attached",
|
||||
|
||||
@@ -83,8 +83,6 @@ class StealthyFetcher(BaseFetcher):
|
||||
"""
|
||||
if not custom_config:
|
||||
custom_config = {}
|
||||
elif not isinstance(custom_config, dict):
|
||||
ValueError(f"The custom parser config must be of type dictionary, got {cls.__class__}")
|
||||
|
||||
with StealthySession(
|
||||
wait=wait,
|
||||
@@ -182,8 +180,6 @@ class StealthyFetcher(BaseFetcher):
|
||||
"""
|
||||
if not custom_config:
|
||||
custom_config = {}
|
||||
elif not isinstance(custom_config, dict):
|
||||
ValueError(f"The custom parser config must be of type dictionary, got {cls.__class__}")
|
||||
|
||||
async with AsyncStealthySession(
|
||||
wait=wait,
|
||||
|
||||
Reference in New Issue
Block a user