Make Selenium undetectable

LADA

Junior Member
Joined
May 28, 2024
Messages
154
Reaction score
48
How to make Selenium code which automates Reddit undetectable?

For proxy and fingerprint part, I’m already automating with AdsPower (antidetect) + rot residential proxy. So this part is done

For technical part, what should I do? For example I’ll add random second mouse movements, what else should I do? I’m kinda new to Selenium, any suggestions would be appreciated greatly
 
You didn't mentioned which programming launguage You will use.

I've never used selenium to automate, just Node.js + puppeteer & playwright

I've played around with some antibot softwares and here are some universal tips for You:

1. Avoid using page.evaluate in Your code to interfere with page elements as it triggers antibots in most cases.
2. Of course - randomize every delay between taken action on a webpage.
3. Emulate as much things as Selenium API provides at their docs https://www.selenium.dev/documentation/webdriver/actions_api/
it means: don't fill inputs programmatically - first focus an input and then send keys etc.
More complex Your script will be, then less chance it will get caught.
4. Less technical but more sensible advice - try to trigger Your actions in human-like schedule, If You're using proxy from central europe then do actions in their timezone, at reasonable hours, like normal reddit user.
 
You didn't mentioned which programming launguage You will use.

I've never used selenium to automate, just Node.js + puppeteer & playwright

I've played around with some antibot softwares and here are some universal tips for You:

1. Avoid using page.evaluate in Your code to interfere with page elements as it triggers antibots in most cases.
2. Of course - randomize every delay between taken action on a webpage.
3. Emulate as much things as Selenium API provides at their docs https://www.selenium.dev/documentation/webdriver/actions_api/
it means: don't fill inputs programmatically - first focus an input and then send keys etc.
More complex Your script will be, then less chance it will get caught.
4. Less technical but more sensible advice - try to trigger Your actions in human-like schedule, If You're using proxy from central europe then do actions in their timezone, at reasonable hours, like normal reddit user.
Hi, appreciate your advice. Didn’t understand what you meant by “Avoid using page”, can you elaborate on that?
 
Hi, appreciate your advice. Didn’t understand what you meant by “Avoid using page”, can you elaborate on that?
Nah, sorry. It's probably puppeteer-based method.

definition is: "Puppeteer allows evaluating JavaScript functions in the context of the page."

Selenium should have its equivalent.

in short - .evaluate is a function called on browser's page object in which You're calling javascript functions like running them inside developer console in Your browser (press f12 -> console). I was testing many things in my main browsers console and then I was simply putting it into page.evaluate to code of my bot. Antibots were kicking me because of that, I've spent many hours to figure that out and rewrite such actions into another approach.

So my #1 advice is related to #3 - as there should be methods & possibilities to make some actions like removing popups from DOM & detecting if some selector exists on webpage by using Your driver api, instead of executing code in page context.
 
Isn't tutorial available on youTube?
The problem is - this keeps changing. Undetectable selenium/puppeteer is a moving target. What is working today might not work tomorrow.

OP, may be try these:
1. undetectable selenium plugin, if available (it is available for puppeteer that I know)
2. Try using the latest browser executable. You can also use chrome directly if you set it up correctly.
3. Make sure the browser agent string is updated, if you are setting it.
4. GPU accelaration - Do some research on this. This is one way to detect you are botting. I forgot what values I used last time lol.
5. Behaviour - things like scrolling, window size, use of tabs etc can give it away. This is very important to make it look like human. Otherwise, even having an undetectable chrome won't help much.
 
sddefault.jpg


https://github.com/ultrafunkamsterdam/undetected-chromedriver
 
the-simpsons-stop.png



If someone wants to use puppeteer and whatnot and avoid using that patched webdriver, then only way is to use stealth browsers like anty, adspower, etc etc.

Of course it depends on your target sites, every case is unique.

But extra plugin is outdated and it never did patch things enough and detections are now evolved a lot in last year alone so .. yeah.. better to use mobile devices then than browsers, unless you really know how to patch things on browser because even anty dolphin leaks
 
I'm getting tired of the constantly moving target, and will probably invest in an antidetect soon enough
Exactly, developing an “undetectable” browser solution on your own is a game of cat and mouse, which can be hard and laborious.
If You have the budget, it is worth using ready-made solutions and devote your time to developing other stages of the project.
 
I'm looking to make my selenium script undetectable as well. Someone is available to help ?
 
Exactly, developing an “undetectable” browser solution on your own is a game of cat and mouse, which can be hard and laborious.
If You have the budget, it is worth using ready-made solutions and devote your time to developing other stages of the project.
Do you have a company ? I'm looking for an expert to make my selenium script undetectable.
 
How to make Selenium code which automates Reddit undetectable?

For proxy and fingerprint part, I’m already automating with AdsPower (antidetect) + rot residential proxy. So this part is done

For technical part, what should I do? For example I’ll add random second mouse movements, what else should I do? I’m kinda new to Selenium, any suggestions would be appreciated greatly
Add random user-agents
 
Just patch the driver at run time with some random values... To give you an idea:
https://github.com/mabinogi233/UndetectedChromedriver
Where multilogin and others have failed a correct implementation of this works perfectly :)
 
Back
Top