Using CSS Selectors : Playwright supports CSS selectors to locate elements based on their attributes, classes, or IDs.
Playwright supports CSS selectors to locate elements based on their attributes, classes, or IDs.
const element = await page.locator('button#submit'); // Locate element with ID 'submit'
await element.click();