Karim shoair commited on
Commit ·
0d0cd8f
1
Parent(s): 88842b1
build: Move click library to be part of the fetchers extra
Browse files- pyproject.toml +1 -1
- scrapling/cli.py +7 -1
pyproject.toml
CHANGED
|
@@ -58,13 +58,13 @@ classifiers = [
|
|
| 58 |
dependencies = [
|
| 59 |
"lxml>=6.0.1",
|
| 60 |
"cssselect>=1.3.0",
|
| 61 |
-
"click>=8.2.1",
|
| 62 |
"orjson>=3.11.3",
|
| 63 |
"tldextract>=5.3.0",
|
| 64 |
]
|
| 65 |
|
| 66 |
[project.optional-dependencies]
|
| 67 |
fetchers = [
|
|
|
|
| 68 |
"curl_cffi>=0.13.0",
|
| 69 |
"playwright>=1.52.0",
|
| 70 |
"rebrowser-playwright>=1.52.0",
|
|
|
|
| 58 |
dependencies = [
|
| 59 |
"lxml>=6.0.1",
|
| 60 |
"cssselect>=1.3.0",
|
|
|
|
| 61 |
"orjson>=3.11.3",
|
| 62 |
"tldextract>=5.3.0",
|
| 63 |
]
|
| 64 |
|
| 65 |
[project.optional-dependencies]
|
| 66 |
fetchers = [
|
| 67 |
+
"click>=8.2.1",
|
| 68 |
"curl_cffi>=0.13.0",
|
| 69 |
"playwright>=1.52.0",
|
| 70 |
"rebrowser-playwright>=1.52.0",
|
scrapling/cli.py
CHANGED
|
@@ -7,7 +7,13 @@ from scrapling.core.utils import log, _CookieParser, _ParseHeaders
|
|
| 7 |
from scrapling.core._types import List, Optional, Dict, Tuple, Any, Callable
|
| 8 |
|
| 9 |
from orjson import loads as json_loads, JSONDecodeError
|
| 10 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
|
| 12 |
__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."
|
| 13 |
__PACKAGE_DIR__ = Path(__file__).parent
|
|
|
|
| 7 |
from scrapling.core._types import List, Optional, Dict, Tuple, Any, Callable
|
| 8 |
|
| 9 |
from orjson import loads as json_loads, JSONDecodeError
|
| 10 |
+
|
| 11 |
+
try:
|
| 12 |
+
from click import command, option, Choice, group, argument
|
| 13 |
+
except ImportError:
|
| 14 |
+
raise ImportError(
|
| 15 |
+
"You need to install scrapling with any of the extras to enable Shell commands. See: https://scrapling.readthedocs.io/en/latest/#installation"
|
| 16 |
+
)
|
| 17 |
|
| 18 |
__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."
|
| 19 |
__PACKAGE_DIR__ = Path(__file__).parent
|