Skip to content

[Bug]: Cross-platform import fail leads to blocked terminal #1737

@bobrossthebest

Description

@bobrossthebest

crawl4ai version

0.8.0

Expected Behavior

While in a crawl run, use 'q' to quit the loop gracefully. Also, not throw errors if code is not ran on Linux.

Current Behavior

  1. Terminal is blocked, the only way to stop the crawl run in to Ctrl-C, leading to plenty of errors being displayed.
  2. At the beginning of any crawl run, an import error is thrown.

Same issue as this bug from another project, which was linked in this bug in your repo

Image

Is this reproducible?

Yes

Inputs Causing the Bug

- Windows Machine
- arun_many function from AsyncWebCrawler
- Default browser config, headless and verbose.
- Run config cache_mode = CacheMode.BYPASS, stream=False

Steps to Reproduce

1. Create a function that uses AsyncWebCrawler.arun_many()
2. Run that function on a non-Linux machine

Code snippets

from crawl4ai import BrowserConfig, CrawlerRunConfig, CacheMode, MemoryAdaptiveDispatcher, CrawlerMonitor, AsyncWebCrawler
import asyncio

async def crawl_list(urls_list: list) -> None:
    browser_config = BrowserConfig(headless=True, verbose=False)
    run_config = CrawlerRunConfig(
        cache_mode=CacheMode.BYPASS,
        stream=False  # Default: get all results at once
    )
    
    dispatcher = MemoryAdaptiveDispatcher(
        memory_threshold_percent=70.0,
        check_interval=1.0,
        max_session_permit=10,
        monitor=CrawlerMonitor(enable_ui=True)
    )
    
    async with AsyncWebCrawler(config=browser_config) as crawler:
        results = await crawler.arun_many(
            urls=urls_list,
            config=run_config,
            dispatcher=dispatcher
        )

if __name__ == "__main__":
    urls_list = ['https://www.google.com', 'https://www.live.com']
    asyncio.run(crawl_list(urls_list))

OS

Windows

Python version

3.12.10

Browser

Default (Chromium?)

Browser version

Default (idk dude)

Error logs & Screenshots (if applicable)

(When pressing Ctrl-C to quit)

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐞 BugSomething isn't working📌 Root causedidentified the root cause of bug

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions