{
 "kind": "tool",
 "slug": "playwright-core",
 "path": "tools/playwright-core/",
 "name": "Playwright Core",
 "maker": null,
 "density": "profile",
 "crumbs": [
  [
   "Tools",
   "tools/"
  ],
  [
   "Scraping, browsers and parsing",
   "tools/scraping-parsing/"
  ]
 ],
 "lead": "Headless browser automation library for cross-browser testing and web scraping.",
 "chips": [
  {
   "label": "Scraping, browsers and parsing",
   "path": "tools/scraping-parsing/"
  },
  {
   "label": "NPM"
  }
 ],
 "primary": {
  "label": "Copy install command",
  "copy": "npm install playwright-core"
 },
 "links": [
  {
   "label": "GitHub",
   "href": "https://github.com/microsoft/playwright"
  },
  {
   "label": "Website",
   "href": "https://playwright.dev"
  }
 ],
 "track": "New versions, deprecation and license changes on your dashboard",
 "verdicts": [
  {
   "key": "license",
   "label": "License",
   "value": "Apache-2.0",
   "status": "yes",
   "sub": "Use it in paid apps",
   "quote": null,
   "note": "License from npm.",
   "src": "https://github.com/microsoft/playwright"
  },
  {
   "key": "maint",
   "label": "Maintained",
   "value": "Maintained",
   "status": "yes",
   "sub": "Last change Nov 24, 2026",
   "note": "Latest GitHub release Nov 13, 2026. ",
   "src": "https://github.com/microsoft/playwright"
  },
  {
   "key": "pop",
   "label": "Used by agents' projects",
   "value": "80 projects",
   "status": "info",
   "sub": "#3 of 141 in its category",
   "note": "Dependency in 80 public GitHub projects set up for AI coding agents that we scanned (1.3%).",
   "src": null
  },
  {
   "key": "agent",
   "label": "Agent access",
   "value": "Community skills",
   "status": "info",
   "sub": "1 skills by others",
   "note": "Agent skills for this library in the skills catalog; community skills are written by others, read them before you install.",
   "src": null
  }
 ],
 "vfoot": "From the package registry and GitHub, checked daily.",
 "blocks": [
  {
   "id": "overview",
   "nav": "Overview",
   "h2": "What Playwright Core does",
   "parts": [
    {
     "t": "prose",
     "text": "One browser engine for Chromium, Firefox and WebKit with several entry points: a test runner, a scripting library, and two agent interfaces (a CLI and an MCP server) where agents act on refs from accessibility snapshots instead of on screenshots."
    }
   ]
  },
  {
   "id": "popularity",
   "nav": "Popularity",
   "h2": "Playwright Core popularity",
   "parts": [
    {
     "t": "stats",
     "items": [
      {
       "n": "86",
       "of": "/ 100",
       "l": "Gid Score, #37 overall"
      },
      {
       "n": "203M",
       "l": "downloads a week, npm"
      },
      {
       "n": "101K",
       "l": "GitHub stars"
      },
      {
       "n": "80",
       "l": "agent projects use it"
      }
     ]
    },
    {
     "t": "small",
     "text": "Gid Score measures public popularity and activity, not quality.",
     "link": "How the Gid Score is calculated",
     "path": "tools/top/"
    }
   ]
  },
  {
   "id": "usage",
   "nav": "How it is used",
   "h2": "How Playwright Core is used",
   "parts": [
    {
     "t": "list",
     "items": [
      "Playwright Core is a dependency in 80 of the 6,258 public GitHub projects set up for AI coding agents that we scanned (1.6% of the 4,867 JavaScript/TypeScript ones), #3 of 141 in scraping, browsers and parsing.",
      "Counting the projects our scan samples by dependency (Solana 3,067, Ethereum and EVM 1,774, 3D and games 3,130, agent frameworks and SDKs 13,750), it appears in 335; those are left out of every share on this page.",
      "The most used alternative in our scan is Puppeteer (86 projects).",
      "Projects that use it most often also use Vitest (73.8%), tsx (60.0%), Zod (72.5%).",
      "It is more common in projects set up for OpenClaw (9.6%) than for Cursor (0.4%)."
     ]
    },
    {
     "t": "h3",
     "text": "By coding agent"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "67 projects, 2.0%",
       "v": "Claude Code",
       "path": "agents/claude-code/"
      },
      {
       "l": "36 projects, 1.2%",
       "v": "GitHub Copilot",
       "path": "agents/github-copilot/"
      },
      {
       "l": "32 projects, 9.6%",
       "v": "OpenClaw",
       "path": "agents/openclaw/"
      },
      {
       "l": "23 projects, 4.9%",
       "v": "Gemini CLI",
       "path": "agents/gemini-cli/"
      },
      {
       "l": "10 projects, 0.4%",
       "v": "Cursor",
       "path": "agents/cursor/"
      },
      {
       "l": "6 projects, 1.3%",
       "v": "OpenAI Codex",
       "path": "agents/openai-codex/"
      },
      {
       "l": "5 projects, 1.5%",
       "v": "OpenCode",
       "path": "agents/opencode/"
      }
     ]
    },
    {
     "t": "h3",
     "text": "Often used with"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "In 73.8% of its projects",
       "v": "Vitest",
       "path": "tools/vitest/"
      },
      {
       "l": "In 60.0% of its projects",
       "v": "tsx",
       "path": "tools/tsx/"
      },
      {
       "l": "In 72.5% of its projects",
       "v": "Zod",
       "path": "tools/zod/"
      },
      {
       "l": "In 52.5% of its projects",
       "v": "ws",
       "path": "tools/ws/"
      },
      {
       "l": "In 51.2% of its projects",
       "v": "undici",
       "path": "tools/undici/"
      },
      {
       "l": "In 48.8% of its projects",
       "v": "Express",
       "path": "tools/express/"
      },
      {
       "l": "In 48.8% of its projects",
       "v": "Sharp",
       "path": "tools/sharp/"
      },
      {
       "l": "In 47.5% of its projects",
       "v": "Commander",
       "path": "tools/commander/"
      }
     ]
    }
   ]
  },
  {
   "id": "profile",
   "nav": "Profile",
   "h2": "Playwright Core in practice",
   "parts": [
    {
     "t": "h3",
     "text": "Strengths"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "Agents click refs, not pixels",
       "v": "The MCP server gives the model an accessibility tree in which each element has a ref. The next tool call then targets that ref. The docs say this needs no vision model and no coordinate guessing."
      },
      {
       "l": "A CLI sized for coding agents",
       "v": "Playwright CLI is aimed at Claude Code, Copilot and similar agents. The maintainers write that it is \"more token-efficient than MCP\" because commands do not load large tool schemas or accessibility trees into the model context."
      },
      {
       "l": "Waiting is built in",
       "v": "Actions wait until elements are actionable, and assertions retry until their conditions are met. The docs present this as the replacement for hand-written timeouts."
      },
      {
       "l": "Scripts without a test runner",
       "v": "The <code>playwright</code> library covers plain automation scripts. The README shows examples for screenshots, A4 PDFs, iPhone emulation and blocking image requests with <code>page.route</code>."
      }
     ]
    },
    {
     "t": "h3",
     "text": "Watch out for"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "Sources describe Playwright, not playwright-core",
       "v": "The README tells you to install <code>playwright</code>, <code>@playwright/test</code>, <code>@playwright/cli</code> or <code>@playwright/mcp</code>. None of these pages explains what <code>playwright-core</code> contains by itself or when to choose it."
      },
      {
       "l": "MCP costs more context than the CLI",
       "v": "The docs' own comparison table rates the MCP server higher on token cost, because tool schemas and snapshots sit in the model context. The CLI is rated lower."
      },
      {
       "l": "MCP opens a visible browser by default",
       "v": "The MCP server starts headed. The CLI defaults to headless. Expect a browser window to appear unless you change the setting."
      }
     ]
    },
    {
     "t": "h3",
     "text": "Take a screenshot with the library"
    },
    {
     "t": "tabs",
     "label": "Example",
     "items": [
      {
       "tab": "Typescript",
       "code": "import { chromium } from 'playwright';\n\nconst browser = await chromium.launch();\nconst page = await browser.newPage();\nawait page.goto('https://playwright.dev/');\nawait page.screenshot({ path: 'screenshot.png' });\nawait browser.close();"
      }
     ]
    }
   ]
  },
  {
   "id": "more",
   "nav": null,
   "spy_as": "profile",
   "h2": "More about Playwright Core",
   "parts": [
    {
     "t": "more",
     "items": [
      {
       "title": "Agent Skills for it",
       "path": "skills/",
       "items": [
        "playwright-core: Battle-tested Playwright patterns for E2E, API, component, visual, accessibility, and security testing. Covers locators, assertions, fixture"
       ]
      },
      {
       "title": "Head to head",
       "items": [
        {
         "text": "Puppeteer vs Playwright Core",
         "note": "used together in 0 projects",
         "path": "tools/compare/puppeteer-vs-playwright-core/"
        }
       ]
      },
      {
       "title": "Packages around it",
       "items": [
        "vitest: test runner",
        "tsx: TypeScript runner",
        "dotenv: env file loader",
        "zod: schema validation",
        "undici: HTTP client",
        "ws: WebSocket library"
       ]
      },
      {
       "title": "More in Scraping, browsers and parsing",
       "path": "tools/scraping-parsing/",
       "items": [
        {
         "text": "Beautiful Soup",
         "path": "tools/beautifulsoup4/"
        },
        {
         "text": "lxml",
         "path": "tools/lxml/"
        },
        {
         "text": "Playwright (Python)",
         "path": "tools/playwright/"
        },
        {
         "text": "Cheerio",
         "path": "tools/cheerio/"
        },
        {
         "text": "fast-xml-parser",
         "path": "tools/fast-xml-parser/"
        },
        {
         "text": "jsonc-parser",
         "path": "tools/jsonc-parser/"
        },
        {
         "text": "Mozilla Readability",
         "path": "tools/mozilla-readability/"
        },
        {
         "text": "linkedom",
         "path": "tools/linkedom/"
        }
       ]
      }
     ]
    }
   ]
  },
  {
   "id": "alternatives",
   "nav": "Alternatives",
   "h2": "Alternatives",
   "parts": [
    {
     "t": "alts",
     "items": [
      {
       "name": "Playwright Core",
       "me": true,
       "facts": [
        "Apache-2.0",
        "Gid 86",
        "203M/wk"
       ]
      },
      {
       "name": "Puppeteer",
       "why": "Headless Chrome/Chromium automation for scraping, testing and screenshot generation.",
       "path": "tools/puppeteer/",
       "facts": [
        "Apache-2.0",
        "Gid 80",
        "16M/wk"
       ]
      },
      {
       "name": "Puppeteer Core",
       "why": "Headless Chrome/Chromium control library for automation and testing.",
       "path": "tools/puppeteer-core/",
       "facts": [
        "Apache-2.0",
        "Gid 80",
        "35.1M/wk"
       ]
      }
     ],
     "more": "Compare Playwright Core with another tool",
     "more_path": "tools/compare/"
    }
   ]
  },
  {
   "id": "start",
   "nav": "Get started",
   "h2": "Get started",
   "parts": [
    {
     "t": "install",
     "intro": "Install it.",
     "code": "npm install playwright-core"
    },
    {
     "t": "h3",
     "text": "Rules for your agent"
    },
    {
     "t": "rules",
     "label": "Paste into AGENTS.md or CLAUDE.md",
     "text": "## Playwright\n- Locate elements with `getByRole`, `getByLabel`, `getByPlaceholder` or `getByTestId`, not brittle CSS paths.\n- Do not add manual sleeps or timeouts. Rely on auto-wait and web-first assertions such as `expect(page).toHaveTitle(...)`.\n- Save login state once with `page.context().storageState({ path: 'auth.json' })` and reuse it with `test.use({ storageState: 'auth.json' })`.\n- Set `trace: 'on-first-retry'` in `playwright.config.ts` and open failures with `npx playwright show-trace trace.zip`.\n- In a large codebase, drive the browser with `playwright-cli` rather than MCP. It has lower token cost and is headless by default.\n- When using the CLI or MCP, act on element refs (e.g. `e21`) from the latest snapshot, not on screen coordinates.\n- In library scripts, always call `await browser.close()` when done.\n"
    }
   ]
  }
 ],
 "glance": [
  [
   "Package",
   "npm playwright-core"
  ],
  [
   "Category",
   "Scraping, browsers and parsing"
  ],
  [
   "License",
   "Apache-2.0"
  ],
  [
   "Latest version",
   "v1.64.1, October 14, 2026"
  ],
  [
   "On GitHub since",
   "November 2019"
  ],
  [
   "Gid Score",
   "85.8"
  ],
  [
   "Rank in category",
   "#3 of 141"
  ],
  [
   "GitHub",
   "microsoft/playwright"
  ],
  [
   "Last change",
   "Nov 24, 2026"
  ]
 ],
 "good": [],
 "checked_line": "From the package registry, GitHub and our scan of public agent projects; numbers update daily.",
 "logo": "https://agentgid.com/media/avatars/microsoft.png"
}