forked from apify/crawlee-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path__init__.py
More file actions
31 lines (27 loc) · 1.38 KB
/
__init__.py
File metadata and controls
31 lines (27 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
from crawlee._utils.try_import import install_import_hook as _install_import_hook
from crawlee._utils.try_import import try_import as _try_import
# These imports have only mandatory dependencies, so they are imported directly.
from ._adaptive_playwright_crawling_context import (
AdaptivePlaywrightCrawlingContext,
AdaptivePlaywrightPostNavCrawlingContext,
AdaptivePlaywrightPreNavCrawlingContext,
)
_install_import_hook(__name__)
# The following imports are wrapped in try_import to handle optional dependencies,
# ensuring the module can still function even if these dependencies are missing.
with _try_import(__name__, 'RenderingType', 'RenderingTypePrediction', 'RenderingTypePredictor'):
from ._rendering_type_predictor import RenderingType, RenderingTypePrediction, RenderingTypePredictor
with _try_import(__name__, 'AdaptivePlaywrightCrawler'):
from ._adaptive_playwright_crawler import AdaptivePlaywrightCrawler
with _try_import(__name__, 'AdaptivePlaywrightCrawlerStatisticState'):
from ._adaptive_playwright_crawler import AdaptivePlaywrightCrawlerStatisticState
__all__ = [
'AdaptivePlaywrightCrawler',
'AdaptivePlaywrightCrawlerStatisticState',
'AdaptivePlaywrightCrawlingContext',
'AdaptivePlaywrightPostNavCrawlingContext',
'AdaptivePlaywrightPreNavCrawlingContext',
'RenderingType',
'RenderingTypePrediction',
'RenderingTypePredictor',
]