{
 "schema_version": 1,
 "generated": "2026-10-20",
 "id": "lexmount-moli--drive-moli-from-playwright-over-cdp",
 "repo": "lexmount/moli",
 "repo_url": "https://github.com/lexmount/moli",
 "repo_slug": "lexmount-moli",
 "title": "Drive Moli from Playwright over CDP",
 "page_title": "How to drive Moli from Playwright over CDP with Moli",
 "summary": "Run a local Moli server and control it from an existing Playwright script.",
 "who": "A developer with an existing Playwright automation who wants a lighter browser backend, triggered by high memory use from a full Chromium install.",
 "problem": "Chromium-based automation uses a lot of memory per session, and moving existing Playwright scripts to another browser usually means rewriting them.",
 "outcome": "A Playwright script that loads a page and prints its body text through the Moli server, with no code changes beyond the connection.",
 "steps": [
  "Install the Moli binary from the README installer.",
  "Run `moli serve` to start the automation server, which serves CDP, WebDriver Classic, and WebDriver BiDi on one endpoint.",
  "Install Playwright in your project with `npm install playwright`. (inferred, check the README)",
  "Run the README Playwright script that calls `chromium.connectOverCDP(\"http://127.0.0.1:9222\")`, then `page.goto` and `page.locator(\"body\").innerText()`."
 ],
 "agent_prompt": "Using the repo lexmount/moli, start the server with `moli serve` and connect Playwright to http://127.0.0.1:9222 with connectOverCDP. Navigate to <target-url> and print the body innerText. Verify that the printed text matches the visible text of the page.",
 "agents": [
  "any"
 ],
 "difficulty": "Advanced",
 "time": "30 minutes",
 "basis": "readme",
 "caveat": "The README says DOM-first mode is the default and that geometry, coordinate input, and screenshots need `moli serve --layout`, so some Playwright calls will fail without that flag.",
 "category": "Research",
 "tags": [
  "Research"
 ],
 "lang": "rust",
 "requirements": [
  "A computer running Linux, macOS, or Windows",
  "Terminal access (PowerShell on Windows)",
  "Permission to download and run the Moli installer from GitHub",
  "A URL to fetch or test"
 ],
 "risk": "none",
 "seen_in_the_wild": false,
 "mentioned_publicly": false,
 "risks": [],
 "best": false,
 "score": 0.7,
 "evidence": [],
 "url": "https://dedupedai.com/use-cases/lexmount-moli/drive-moli-from-playwright-over-cdp/",
 "md": "https://dedupedai.com/use-cases/lexmount-moli/drive-moli-from-playwright-over-cdp/index.md",
 "disclaimer": "Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked \"Seen in the wild\", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email hello@dedupedai.com and we will look at it promptly.",
 "api": "https://dedupedai.com/api/v1/usecases/lexmount-moli--drive-moli-from-playwright-over-cdp.json",
 "api_version": "v1"
}
