fix: Fixes to handle the new extra deps group
This commit is contained in:
+3
-3
@@ -10,10 +10,10 @@ from orjson import loads as json_loads, JSONDecodeError
|
||||
|
||||
try:
|
||||
from click import command, option, Choice, group, argument
|
||||
except ImportError:
|
||||
raise ImportError(
|
||||
except (ImportError, ModuleNotFoundError) as e:
|
||||
raise ModuleNotFoundError(
|
||||
"You need to install scrapling with any of the extras to enable Shell commands. See: https://scrapling.readthedocs.io/en/latest/#installation"
|
||||
)
|
||||
) from e
|
||||
|
||||
__OUTPUT_FILE_HELP__ = "The output file path can be an HTML file, a Markdown file of the HTML content, or the text content itself. Use file extensions (`.html`/`.md`/`.txt`) respectively."
|
||||
__PACKAGE_DIR__ = Path(__file__).parent
|
||||
|
||||
@@ -4,7 +4,7 @@ from mcp.server.fastmcp import FastMCP
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
from scrapling.core.shell import Convertor
|
||||
from scrapling.engines.toolbelt import Response as _ScraplingResponse
|
||||
from scrapling.engines.toolbelt.custom import Response as _ScraplingResponse
|
||||
from scrapling.fetchers import (
|
||||
Fetcher,
|
||||
FetcherSession,
|
||||
|
||||
@@ -24,13 +24,9 @@ from scrapling.core._types import (
|
||||
Any,
|
||||
)
|
||||
|
||||
from .toolbelt import (
|
||||
Response,
|
||||
generate_headers,
|
||||
__default_useragent__,
|
||||
)
|
||||
from .toolbelt.custom import Response
|
||||
from .toolbelt.convertor import ResponseFactory
|
||||
from .toolbelt.fingerprints import generate_convincing_referer
|
||||
from .toolbelt.fingerprints import generate_convincing_referer, generate_headers, __default_useragent__
|
||||
|
||||
_UNSET = object()
|
||||
|
||||
|
||||
@@ -1,11 +1 @@
|
||||
from .custom import (
|
||||
BaseFetcher,
|
||||
Response,
|
||||
StatusText,
|
||||
get_variable_name,
|
||||
)
|
||||
from .fingerprints import (
|
||||
generate_headers,
|
||||
get_os_name,
|
||||
__default_useragent__,
|
||||
)
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ Functions related to custom types or type checking
|
||||
"""
|
||||
|
||||
from functools import lru_cache
|
||||
from email.message import Message
|
||||
|
||||
from scrapling.core.utils import log
|
||||
from scrapling.core._types import (
|
||||
|
||||
@@ -17,7 +17,7 @@ from scrapling.engines._browsers import (
|
||||
AsyncDynamicSession,
|
||||
AsyncStealthySession,
|
||||
)
|
||||
from scrapling.engines.toolbelt import BaseFetcher, Response
|
||||
from scrapling.engines.toolbelt.custom import BaseFetcher, Response
|
||||
|
||||
__FetcherClientInstance__ = _FetcherClient()
|
||||
__AsyncFetcherClientInstance__ = _AsyncFetcherClient()
|
||||
|
||||
Reference in New Issue
Block a user