Hey @d1337edu , great question, and totally valid curiosity, especially if you’re learning and experimenting.
You’re right that bots often get flagged for unnatural behavior, like the mouse snapping to (0,0) or not moving at all. Selenium itself doesn’t maintain real cursor state across page loads, since it’s not designed for that level of simulation. But here are a few things that might help reduce detection:
- Use undetected-chromedriver: This can bypass many basic bot detection scripts. It’s a drop-in replacement for Selenium’s ChromeDriver.
- Simulate mouse movement manually: You can use libraries like
pyautoguior JavaScript injection to simulate cursor movement. It won’t be perfect, but it can add some noise to avoid static behavior. - Preserve cursor “state” visually: Before navigation, record cursor position and inject a JS script after load to move the cursor back to that spot, even if just for visual consistency. It’s not stealthy per se, but it can reduce visual flags.
- Avoid full page reloads: Try interacting via AJAX or dynamic content loading where possible, to reduce the bot fingerprint resets.
- Block or spoof telemetry: This is tricky, but tools like Puppeteer-extra-plugin-stealth (more common in JS) do this. In Selenium/Python, it’s harder but not impossible; you can block known telemetry domains via a proxy or CDP.
Just remember, there’s no perfect cloak, especially as anti-bot systems evolve quickly. But experimenting with these ideas will definitely help you learn what’s possible!
Hope this was helpful ![]()