← Learning

Playwright

A linear, one-concept-per-lesson path through Playwright, from launching your first browser to an end-to-end web research agent. 24 lessons · 3 tiers.

Prerequisites: Completion of LangChain & Agent Building through Lessons 13-16 (@tool, bind_tools), or already comfortable with those. Playwright lessons build ordinary Python functions first, browser-only, no LLM involved, then wire the same functions in as agent tools later in the course, exactly like any other @tool.

Lessons use Google's Gemini free tier (gemini-3.5-flash-lite), the same model as the other courses, but only from Lesson 16 onward, where an LLM is first wired to a Playwright tool; Lessons 1-15 are pure browser automation, no API key needed. Setup also needs the Playwright browser binaries themselves, a one-time `uv run playwright install chromium` download separate from the Python package.

Built on Playwright, the browser automation library this course teaches.

Course source

Every lesson's README and lesson.py for this course live in the ai-agent-engineering repo.

View on GitHub →
Playwright

Beginner

Launching a browser, locators, clicking, typing, reading a page back.

  1. 01What Is Playwright?GitHub
  2. 02Installing the BrowsersGitHub
  3. 03Launching a BrowserGitHub
  4. 04Navigating to a PageGitHub
  5. 05Locators and Selecting ElementsGitHub
  6. 06Clicking and TypingGitHub
  7. 07Reading Content Off a PageGitHub
  8. 08Checkpoint: Scrape a Page Into a ListGitHub

Intermediate

Real pages, real forms, structured data, and a first tool wiring into LangChain.

  1. 09Waiting StrategiesGitHub
  2. 10Filling and Submitting FormsGitHub
  3. 11Multi-Page NavigationGitHub
  4. 12Screenshots and PDFsGitHub
  5. 13Extracting Structured DataGitHub
  6. 14Handling Dialogs and DownloadsGitHub
  7. 15Wrapping Playwright as a ToolGitHub
  8. 16Wiring It Into LangChainGitHub
  9. 17Checkpoint: An Agent That Searches a Site and Reports BackGitHub

Advanced

Auth, network interception, parallelism, resilience, and safety with untrusted pages.

  1. 18Authentication and Storage StateGitHub
  2. 19Network InterceptionGitHub
  3. 20Parallel ContextsGitHub
  4. 21Retries and Flaky PagesGitHub
  5. 22Running Headless in DockerGitHub
  6. 23Safety With Untrusted PagesGitHub
  7. 24Capstone: An End-to-End Web Research AgentGitHub
Start at Lesson 1

Contact

Book a Call