Playwright icon

Playwright

Automate browser actions using Playwright

Click Element

AI-generated

Summary

Click on an element located on a webpage at a specified URL using a CSS selector or XPath expression with the Playwright browser automation library.

Inputs

  • URL (required) — The web page URL to navigate to before performing the click action.
  • Selector Type (required) — Specify whether to use a CSS selector or XPath to identify the element to click.
  • CSS Selector (required) — The CSS selector string for the element to be clicked (required if Selector Type is CSS).
  • XPath (required) — The XPath expression for the element to be clicked (required if Selector Type is XPath).
  • Browser — The browser engine to use (Chromium, Firefox, or Webkit); defaults to Chromium.
  • Browser Launch Options — Options to control how the browser is launched, including headless mode and slow motion (delay) between actions.

Output shape

a single JSON object indicating success and echoing the selector used

Returns JSON containing success status, the selector type used, and the selector string. Operation navigates to the URL, performs the click, then closes the browser. No binary data returned.

Examples

Example 1: Click the submit button on a webpage

Set URL to the webpage, Selector Type to 'CSS Selector', and CSS Selector to '#submit-button'. Choose browser and launch options as needed.

Links

Discussion