Skip to content

Install

Step 1 - Install the Python packages

bash
pip install langchain-community playwright

langchain-community ships the PlayWrightBrowserToolkit class and all seven browser tools. playwright is the Microsoft Playwright Python binding (version >=1.28.0,<2.0.0 is required by langchain-community).

Step 2 - Install Playwright browsers

After the pip install, download the browser binaries. Chromium is sufficient for most use cases:

bash
playwright install chromium

To install all supported browsers (Chromium, Firefox, WebKit):

bash
playwright install

Optional - install system dependencies (Linux / CI)

On headless Linux servers the browsers need OS-level libraries. Install them with:

bash
playwright install-deps

Full one-liner for CI

bash
pip install langchain-community playwright && playwright install chromium

Dependency matrix

RequirementVersion pin
Python3.9 or higher
playwright>=1.28.0, <2.0.0
langchain-corerequired (pulled in transitively)
langchain-communitylatest stable (e.g. 0.3.x)