crawl4ai icon indicating copy to clipboard operation
crawl4ai copied to clipboard

Fix cdp_url import into the managed browser

Open mikamind opened this issue 1 year ago • 1 comments

Summary

I've squashed a bug where the cdp_url was being ignored, even when it was clearly specified in the BrowserConfig. Now, the managed browser gets the proper cdp_url injection it needs for any remote connections.

List of files changed and why

async_crawler_strategy.py - Updated the ManagedBrowser initialization to ensure the cdp_url from the BrowserManager's config is passed along.

How Has This Been Tested?

Simply pass any valid cdp_url into the BrowserConfig. Previously, it was being overlooked. With this fix, the URL is now correctly passed along, confirming our solution works as intended.

Checklist:

  • [x] My code follows the style guidelines of this project
  • [x] I have performed a self-review of my own code
  • [x] I have commented my code, particularly in hard-to-understand areas
  • [x] I have made corresponding changes to the documentation
  • [x] I have added/updated unit tests that prove my fix is effective or that my feature works
  • [x] New and existing unit tests pass locally with my changes

mikamind avatar Feb 08 '25 12:02 mikamind

@mikamind Thanks for sending in this PR. We'll review and consider this for release in the upcoming alpha.

aravindkarnam avatar Feb 10 '25 04:02 aravindkarnam

why not accepted? It's literally a one line fix. I found this PR after searching for why my crawler doesn't use CDP...

hakzarov avatar Feb 16 '25 23:02 hakzarov