# Click Action

Source: https://docs.scrappey.com/docs/click-action

> Simulate a click on a specific element on a webpage using a CSS selector or XPath within a browser session.

## Command

`"click"`

## Parameters

| Parameter         | Type    | Required | Description                                              |
| ----------------- | ------- | -------- | -------------------------------------------------------- |
| `cssSelector`     | string  | Yes      | CSS selector or XPath of the element to click.           |
| `wait`            | number  | No       | Wait for X seconds after clicking.                       |
| `waitForSelector` | string  | No       | Wait for a specific element to appear after the click.   |
| `when`            | string  | No       | Lifecycle phase to run the action: `beforelaunch`, `beforeload`, `afterload`, or `after_captcha`. Default is `afterload`. |
| `ignoreErrors`    | boolean | No       | Set to `true` to continue even if an error occurs.       |

## Example

```bash
curl -X POST "https://publisher.scrappey.com/api/v1?key=YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "cmd": "request.get",
    "url": "https://example.com",
    "browserActions": [
      {
        "type": "click",
        "cssSelector": "#exampleButton"
      }
    ]
  }'
```

## Related concepts

Go deeper in the [Scrappey knowledge base](https://scrappey.com/qa):

- [Playwright](https://scrappey.com/qa/web-scraping-apis/what-is-playwright) — the automation engine behind browser actions
- [Headless browsers](https://scrappey.com/qa/web-automation/headless-browsers-guide) — driving a real browser to scrape
