Skip to content
masterclass Buddy

Playwright · Method

locator.last

locator.last returns a locator for the last element that matches another locator. Use it when you need the final match in a set.

Last updated

Since
v1.14

Syntax

locator.last

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • Locator
  • locator.first
  • locator.nth
  • locator.all

Source: Locator | Playwright Python. Checked 2026-11-03.