Seatext library / BotRefund evidence

How Machine Learning Can Help Identify Playwright Traffic

Machine learning identifies Playwright traffic by analyzing patterns across many browser, network, hardware, and behavior signals together instead of relying on a single clue. It can flag sessions as human or automated with high...

Built for advertisers who need clear, refund-ready traffic evidence.

Machine learning helps identify Playwright traffic by looking at the whole pattern of a session, not just one suspicious property. A model can learn to combine signals like mouse movement, browser settings, network behavior, and page interaction speed to decide if a visit is human or automated.

Playwright bots often mimic real browsers closely, so simple checks like user-agent strings or IP addresses are not enough. ML works because it sees how 106 different signals fit together before making a decision. This gives a more reliable answer than any single browser flag.

What machine learning adds to Playwright detection

Traditional detection rules check for known bad IPs, unusual user agents, or automation properties like navigator.webdriver. These rules catch basic bots. But Playwright can be configured to hide those obvious markers. That is where machine learning changes the outcome.

Instead of saying “this signal is bad,” an ML model assigns weight to dozens of signals and looks at how they combine. For example, a human visitor might have a slight mouse tremor, a varied reading speed, and a consistent timezone. A Playwright bot may have perfectly straight pointer paths, superhuman click speed (<1ms), and a missing humanlike jitter. Any one of those could happen with a real user, but together they form a pattern that ML can recognize.

ML also improves over time. Once you collect data and label sessions as human or bot, you can train a classifier that learns new evasive patterns. This makes it harder for bot creators to guess which check you use.

How to apply ML step by step

  1. Capture session data. Add a script to your pages that records browser, network, hardware, and behavior signals. You need data from real humans and from known Playwright bots.
  2. Extract meaningful features. From the raw data, create features such as pointer movement patterns, click timing, timezone consistency, WebRTC leaks, DNS routing, and automation property flags.
  3. Label your training set. Mark each session as human or bot. You can label known test sessions, sanitize logs, or use a trusted private proxy pool to generate bot samples.
  4. Train a classification model. Use a supervised algorithm like gradient boosting, random forest, or logistic regression. Start with a binary classification problem: human vs automated.
  5. Score each new session. Run the model in real time or near-real-time. The output is a probability that the session is bot traffic. Set a threshold, and then flag sessions that cross it.
  6. Verify the output. Manually review a sample of flagged sessions. Check that each flagged session shows at least two unrelated signals pointing to automation. If false positives are high, adjust the threshold or add more training data.

If building your own model sounds too heavy, you can use a service that already does this. BotRefund’s prediction AI, for example, silently combines 106 signals and gives you a decision about whether a visit is human or automated.

Prerequisites for an ML-based detector

  • Good data. You need labeled sessions that represent both real users and Playwright bots. Without a balanced, high-quality dataset, your model will guess wrong.
  • A feature pipeline. You need to turn raw browser events into clear numerical features. For example, compute entropy of pointer paths, time between clicks, or consistency of DNS routes.
  • A way to collect client-side signals. ML detection works best with JavaScript that runs in the browser. Server-side logs give you some network signals but miss behavior.
  • Real-time or batch scoring. Decide how fast you need the decision. Ad click fraud needs near-real-time blocking. A nightly log review may be enough for other uses.
  • Model maintenance. Bots evolve. Plan to retrain your model periodically as new Playwright configurations appear.

The signal categories that matter

Not every signal carries equal weight. According to BotRefund’s detection page, signals fall into three groups:

Network, VPN, and geolocation signals

These check whether the visitor’s network identity is coherent. Examples include WebRTC leaks, DNS routing mismatches, timezone and language mismatches, and IP inconsistency. Playwright bots often have small inconsistencies here because they run through proxies or virtual environments.

Evasion, debugger, and anti-stealth signals

These look for traces left by browser automation or masking tools. CDP debugger leaks, native patching, engine mismatches, and automation properties are all red flags. Playwright uses the Chrome DevTools Protocol, so it often leaves these traces.

Behavioral signals

This group covers how a visitor interacts with your page. BotRefund watches for ghost clicks, honeypot trap interactions, robotic linear mouse movements, absence of humanlike tremor, superhuman input speed, grid-aligned movement, and unnatural session durations. These patterns are hard for a simple script to fake convincingly.

Key facts at a glance

FactDetail
Signals used for detection106 browser, network, hardware, and behavior signals are evaluated together
Accuracy claim99% accurate at detecting bots (per BotRefund)
Typical ad spend drain from botsUp to 20% of Google and Meta ad spend can be lost to bot clicks
Refund success rate83% refund success rate for high-volume advertisers

These figures come from the provider’s public materials. They are a starting point, not a guarantee for every site.

Limitations and when ML advice does not apply

Machine learning is not magic. A sophisticated attacker can try to fool your model by mimicking human behavior more carefully. Because Playwright lets you control mouse movement, timing, and even device profiles, a determined bot can still pass if your model only looks at one or two signals.

Also, ML detection is not the same as filtering your own test traffic. If your QA team uses Playwright against production, you may want to let those sessions through. In that case, mark them with a special cookie or header so your detection model can exclude them. ML detection is about catching unauthorized automation, not about banning Playwright entirely.

The source-pack examples focus on ad click fraud. If your problem is web scraping or account farming, the same principles apply, but your signal mix may need adjustment. And if you have very low traffic, you may not have enough data to train a reliable custom model. In that case, a pre-built service is often the faster route.

Frequently asked questions

What makes Playwright traffic different from other bots?

Playwright drives a real Chromium, Firefox, or WebKit browser. This means it can render JavaScript and HTML like a human browser. The difference shows up in fine details: pointer paths, event timing, and some internal browser properties that are hard to fully mask.

Can I identify Playwright traffic without machine learning?

Yes, for basic cases you can check for automation properties, CDP leaks, or superhuman speed. But modern Playwright configurations can hide many of those. ML raises your chances because it looks at many signals together.

How many signals do I need to collect?

There is no fixed number. Start with 20–30 core signals. More helps when they are independent and relevant. The provider BotRefund uses 106, but quality of features matters more than raw count.

Does ML detection work in real time?

Yes. Once the model is trained, scoring a session is fast—usually under 50 milliseconds. You can run it during page load or when a click happens.

What should I do after the model flags a session?

You can block the session, send it to a challenge page, or simply record it as invalid. For ad accounts, you also want to save evidence—like click IDs and behavioral logs—in case you file a refund claim.

What should I compare when choosing a detection tool?

Look at signal coverage, integration effort, real-time performance, and refund support. Also ask about false-positive rates. A tool that blocks too many real users is worse than one that lets a few bots through.

Further reading and comparison sources

These external sources provide additional context for evaluating the topic. Their inclusion is not an endorsement.

Learn more

Visit the website for more information.

Learn more