PB
Available
arrow_back Back to Blog

Auto Click a Button on a Webpage at Set Intervals

PB

Patrick Bushe

January 2, 2026 · 5 min read

There are more reasons to auto-click a button than you might expect:
keeping an internal tool's session from timing out, loading paginated results
without scrolling, auto-confirming a workflow step on a schedule, or
bypassing a still-there idle timeout on a corporate system.

Here are the approaches, from lightest to most capable.

The console approach

For a one-off need, a quick console script works:

setInterval(() => {
document.querySelector('button').click();
}, 60000);

Replace the button selector with a more specific CSS selector to target the
right element. You can get this from DevTools — right-click the button,
Inspect, then right-click the element in the DOM and choose Copy Selector.

Limitations: the script stops when the page reloads, and it won't survive
if the page navigates as a result of the click (loading a new page resets
the console context).

For multi-step flows that involve navigation, you need something more
persistent.

Using AutoBrowser for scheduled auto-click

AutoBrowser's click automation feature lets you set up a button click rule
that persists across page reloads and browser restarts.

1. Navigate to the page with the button you want to auto-click
2. Open AutoBrowser and select Auto Click
3. Click Pick Element and hover over the target button — it highlights
as you hover. Click to select it.
4. AutoBrowser captures the element's selector. You'll see a preview
of the selected element in the popup.
5. Set the interval and enable the rule

For session keep-alive use cases:
Set the interval to slightly less than the session timeout. If your corporate
intranet times out after 15 minutes of inactivity, set the click interval
to 10 minutes. AutoBrowser will click the target just often enough to
prevent the timeout.

For Load More pagination:
Some sites paginate content behind a Load More button. AutoBrowser can
click this button on a short interval (every 3-5 seconds) to progressively
load all content on the page — useful when you need to see everything before
exporting or searching the page text.

Important: conditional clicking

Blind clicking at an interval can cause problems if the button disappears
or changes state. AutoBrowser checks whether the target element is still
present and visible before attempting the click. If the element isn't found
on a given cycle, it skips the click and logs the miss rather than throwing
an error. This prevents issues on pages where the button only appears under
certain conditions.

You can also set a click limit — maximum number of clicks before the rule
deactivates — which is useful for the Load More use case where you want
to click up to 20 times then stop.

Be thoughtful about what you automate

Auto-clicking can trigger unintended consequences on certain pages. An
accidental double-submit, a repeated purchase confirmation, or repeated
form submissions can cause real problems. Before setting up a click rule:

  • Confirm the button is idempotent (clicking it twice has the same effect
  • as clicking it once)
  • Test with the interval set high at first (every 5 minutes) to verify
  • behavior before tightening the schedule
  • Check whether the site's terms of service prohibit automated interaction
  • (this matters for e-commerce sites and anything with rate limiting)

Debugging a click rule that isn't working

If you set up a click rule and the button isn't being clicked, the most
common causes are: the element selector has changed (site updated its HTML),
the element is inside a shadow DOM (which content scripts can't penetrate
by default), or the element only appears after user interaction and isn't
visible on page load.

To debug: open AutoBrowser, navigate to the Click Rules section, and use
the Test Click button. This triggers a manual click attempt and shows
you whether the selector resolves to an element and whether the click
fired. If the selector resolves but the click has no effect, the element
may be intercepting the click event and preventing the action you expect.

Auto-clicking for form testing

Developers sometimes need to trigger a form submission or button click
repeatedly during testing. Instead of writing a Playwright or Puppeteer
script for simple cases, AutoBrowser can handle this inline. Set up a
click rule on your Submit button with a 5-second interval, watch the
network tab in DevTools, and observe the requests. Much faster to set up
than a dedicated test script for quick sanity checks.

Combining auto-click with auto-refresh

Some workflows need both: refresh the page, then click a specific button
after the page loads. AutoBrowser supports sequenced actions — you can
chain a click action to fire a configurable delay after each refresh.
This handles the common case of logging into a page (click the login
button after the page loads) or dismissing a cookie banner (click Accept
before interacting with the page).

The delay between refresh and click should be set to slightly more than
the page's typical load time plus any animation delay on the target element.
Start with a 2-3 second delay and adjust based on observed behavior.

More Tools by Patrick Bushe

Free Chrome extensions to boost your productivity and privacy