When installing crawlee like this:
And then importing BeautifulSoupCrawler.
I would get just a general ImportError.
Add some import checks and print user-friendly error messages. E.g.:
try:
from bs4 import BeautifulSoup
except ImportError as exc:
raise ImportError(
'To use this module, you need to install the "beautifulsoup" extra. Run "pip install crawlee[beautifulsoup]".',
) from exc
Check https://github.com/apify/apify-sdk-python/blob/master/src/apify/scrapy/scheduler.py#L5:L13 as inspiration.
When installing crawlee like this:
And then importing
BeautifulSoupCrawler.I would get just a general
ImportError.Add some import checks and print user-friendly error messages. E.g.:
Check https://github.com/apify/apify-sdk-python/blob/master/src/apify/scrapy/scheduler.py#L5:L13 as inspiration.