Appearance
LangChain Playwright Toolkit
Category: Classic
Package: langchain-community (Python)
Cost: Free / open source
Official docs: https://python.langchain.com/docs/integrations/toolkits/playwright
GitHub source: langchain-ai/langchain (libs/langchain/langchain_classic/agents/agent_toolkits/playwright)
What it is
PlayWrightBrowserToolkit is a LangChain BaseToolkit that wraps Microsoft Playwright and exposes seven browser-control tools an LLM agent can call by name. It ships as part of langchain-community and lets you give any LangChain agent the ability to navigate pages, click elements, read text, extract links, and inspect the DOM inside a real Chromium, Firefox, or WebKit browser.
The toolkit supports both a sync and an async Playwright browser. You pass one in at construction time; the toolkit wires it to every tool automatically.
Included tools
| Tool class | Tool name (used by the agent) | What it does |
|---|---|---|
NavigateTool | navigate_browser | Navigate to a URL (http/https only by default) |
NavigateBackTool | previous_webpage | Go back one page in browser history |
ClickTool | click_element | Click a DOM element by CSS selector |
ExtractTextTool | extract_text | Extract visible text from the current page |
ExtractHyperlinksTool | extract_hyperlinks | Extract all hyperlinks from the current page |
GetElementsTool | get_elements | Get DOM elements matching a CSS selector |
CurrentWebPageTool | current_webpage | Return the URL of the current page |
Security note
By default the toolkit allows navigation to any URL, including internal network addresses and local files. When exposing this toolkit to end users, restrict network access on the host or subclass NavigateTool with a custom args_schema that limits permitted URL prefixes. See https://python.langchain.com/docs/security.
Free vs paid
Completely free and open source (MIT licence via the langchain-community package). Playwright itself is also free (Apache 2.0). No API key required.
Template / starter
No official downloadable boilerplate exists. The usage pattern is short enough that the code on the Usage page is the canonical starting point.