Browser Sessions: Stateful Web Automation Behind a CDP Connection Most web automation breaks the moment a site asks you to log in. Your scraper fetches the login page, posts credentials, and then... loses the session cookie on the next request because it spun up a fresh context. Or it hits a JS-rendered dashboard and gets back an empty <div id="app"></div> . The root problem is statefulness. HTTP is stateless by design, and most scraping tools treat each request as isolated. But real user flows are not isolated. Logging in, clicking through a multi-step form, waiting for a WebSocket to push data, then reading the result: that is a single continuous session, and automating it requires a browser that remembers where it has been. This is where Chrome DevTools Protocol (CDP) sessions come in. What CDP Actually Gives You CDP is the protocol Chrome and Chromium expose for external control. Tools like Playwright and Puppeteer sit on top of it.…