You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 200ebfa
Browse filesBrowse the repository at this point in the historyBrowse files
fix: add explicit err msgs for missing pckg extras during import (#165)
## Description
- Add explicit error messages for missing package extras during import.
- It applies to BrowserPool, BeautifulsoupCrawler, and
PlaywrightCrawler.
- Also until now the Playwright was mandatory for even `BasicCrawler`,
fixing it.
## Related issues
- Closes#155
## Testing
### PlaywrightCrawler
```
ImportError Traceback (most recent call last)
Cell In[3], line 1
----> 1 from crawlee.playwright_crawler import PlaywrightCrawler
File ~/Projects/crawlee-py/src/crawlee/playwright_crawler/__init__.py:5
3 from .types import PlaywrightCrawlingContext
4 except ImportError as exc:
----> 5 raise ImportError(
6 'To use this module, you need to install the "playwright" extra. Run "pip install crawlee[playwright]".',
7 ) from exc
ImportError: To use this module, you need to install the "playwright" extra. Run "pip install crawlee[playwright]".
```
### BeautifulsoupCrawler
```
ImportError Traceback (most recent call last)
Cell In[1], line 1
----> 1 from crawlee.beautifulsoup_crawler import BeautifulSoupCrawler
File ~/Projects/crawlee-py/src/crawlee/beautifulsoup_crawler/__init__.py:5
3 from .types import BeautifulSoupCrawlingContext
4 except ImportError as exc:
----> 5 raise ImportError(
6 'To use this module, you need to install the "beautifulsoup" extra. Run "pip install crawlee[beautifulsoup]".',
7 ) from exc
ImportError: To use this module, you need to install the "beautifulsoup" extra. Run "pip install crawlee[beautifulsoup]".
```
### BrowserPool
```
ImportError Traceback (most recent call last)
Cell In[2], line 1
----> 1 from crawlee.browsers import BrowserPool
File ~/Projects/crawlee-py/src/crawlee/browsers/__init__.py:5
3 from .playwright_browser_plugin import PlaywrightBrowserPlugin
4 except ImportError as exc:
----> 5 raise ImportError(
6 'To use this module, you need to install the "playwright" extra. Run "pip install crawlee[playwright]".',
7 ) from exc
ImportError: To use this module, you need to install the "playwright" extra. Run "pip install crawlee[playwright]".
```
## Checklist
- [x] Changes are described in the `CHANGELOG.md`
- [x] CI passed
0 commit comments