The Solution:
I’ve built a streamlined solution—a Docker image that runs Chrome with all its necessary dependencies and exposes a FastAPI interface. This decouples the browser logic from your main codebase, letting you focus on scraping or automation without worrying about the underlying setup.
The container exposes a WebSocket endpoint at ws://localhost:8000/ws, allowing you to connect Playwright or Puppeteer over Chrome DevTools Protocol (CDP). For example:
browser = await pw.chromium.connect_over_cdp('ws://localhost:8000/ws')
Each connection to the WebSocket spins up a new Chrome session in headed mode, and you can run multiple sessions concurrently.
Unlike other solutions, Finic is fully open-source (Apache 2.0 licensed). You can try it by pulling the official Docker image or cloning the repo at Finic on GitHub (https://github.com/finic-ai/finic) and running `docker-compose up --build`.
This approach simplifies handling Chrome for scraping, saves on cloud costs, and keeps your setup clean. Give it a try!