patrols

patrols

CDPEx - Drive Chrome from Elixir over the Chrome DevTools Protocol

CDPEx is a Chrome DevTools Protocol client for Elixir. It drives a real Chrome straight over CDP, with no ChromeDriver, Selenium, or WebDriver sitting in between. I wrote it to replace Wallaby/ChromeDriver in a production scraping app, and it’s now the only browser engine that app runs on.

You launch a Chrome, drive a page, and CDPEx reaps the OS process for you when the page is done, so you don’t end up with a pile of orphaned Chrome processes.

CDPEx.with_page([], fn page ->
  {:ok, _} = CDPEx.Page.navigate(page, "https://example.com")
  CDPEx.Page.wait_for_network_idle(page)
  CDPEx.Page.screenshot(page, path: "shot.png")
end)
# Chrome launched, driven, and cleaned up. Nothing left running.

What it does:

  • with_page/3 runs your code with a fresh page and guarantees teardown, even if your function raises
  • Real, trusted input: clicks and keystrokes go through Chrome as genuine user gestures (event.isTrusted == true), not synthetic JS events
  • Connects to a remote or already-running Chrome over ws(s)://, as well as launching one locally
  • Navigation, evaluate, screenshots, and PDF rendering
  • Network observation, including waiting for the network to go idle
  • Proxy support with authentication
  • :telemetry instrumentation and an optional warm browser pool

It’s running in production right now, rendering JS-heavy pages, including ones behind JS challenges and Cloudflare. It’s a real browser running real JS, so no stealth tricks are involved.

It’s pre-1.0, so the API can still change, and stealth or anti-bot evasion is out of scope on purpose. It has held up well under daily load so far.

The package is on Hex and the docs are on HexDocs. Happy to answer questions or hear what you think is missing.

First 3 of 3 Posts! Switch mode

felix-starman

felix-starman

Hey, just curious if there was anything in particular missing that you needed that Bibbidi did not have?

I’m trying to make sure that Bibbidi can be resilient and bulletproof for everyone regardless of browser

patrols

patrols

Hey Felix! honest answer: I didn’t know about Bibbidi when I started. When I looked around, most of what I found either wrapped ChromeDriver/WebDriver or pulled in a full Playwright/Puppeteer-style layer, and I wanted something small that talks CDP directly, mainly for a scraping pipeline I run in production. So it wasn’t a specific feature Bibbidi was missing; I just didn’t find it when I searched, and by the time I might have, I’d already built the thing.

I’ll take a proper look at Bibbidi though, curious how you approached it

felix-starman

felix-starman

All good.

Version 0.4 is basically ready but I’m adding usage docs to a bunch of modules.

And then I have a plan for library called Bobbidi that is more high level but would still be like a middleware for an RPA library

Where Next?

Trending in Announcing Top

bluzky
You may know https://ui.shadcn.com/, a UI component library for React. I really love it’s design style and components. I’ve built some co...
385 14863 120
New
JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
shahryarjb
The Chelekom project is a library of Phoenix and LiveView components generated via Mix tasks to fit developer needs seamlessly. One of i...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve. They are GUI (Emerge) and State management (S...
New
ausimian
Emily is an Elixir library that runs Nx computations on Apple’s MLX. Install it as the default Nx backend and Nx, defn, Axon, Nx.Serving,...
New
zachdaniel
Introducing AshStorage! Attachment and file management that slots directly into your resources :smiling_face_with_sunglasses: I had hope...
New

Other Trending Topics Top

type1fool
I just stumbled on a newly redesigned elixir-lang.org. :tada: It looks like @Software_Mansion did the work, and I think it is generally a...
New
akoutmos
@hugobarauna and I (Alex Koutmos) have been hard at work on writing a book on Nerves that takes you from simply blinking LEDs to building...
New
juhalehtonen
There has been a thread to discuss the Stack Overflow Developer Survey on this forum every year since 2018, so here’s yet another one for...
New
bjorng
We want to introduce a new native datatype to Erlang: native records. Although replacing all tuple records with native records is not our...
New
spammy
I’m looking to build a personal workflow to quickly deploy web applications written in elixir/phoenix, for local consumption (ie not on t...
New
yureehuh
Introduction Founded in 2017 by landscape ecologist and fire mitigation expert Harry Statter, Frontline developed the first fully integra...
New

We're in Beta

About us Mission Statement