This pull request addresses an issue where the screenshot functionality in AsyncWebCrawler is not working as expected, leading to an assertion error.
Issue
When using the sample code to run the crawler with screenshot=True, an AssertionError is raised because the result.screenshot is None:
Sample Code:
async with AsyncWebCrawler(verbose=False) as crawler:
result = await crawler.arun(url="https://example.com", screenshot=True, bypass_cache=True)
assert result.success is True
assert result.screenshot is not None, "Screenshot is None"
Output
assert result.screenshot is not None, "Screenshot is None"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: Screenshot is None
Description
This pull request addresses an issue where the screenshot functionality in AsyncWebCrawler is not working as expected, leading to an assertion error.
Issue
When using the sample code to run the crawler with screenshot=True, an AssertionError is raised because the result.screenshot is None:
Sample Code:
Output