So there is this chat website where you go, click "connect as guest", enter your username, complete a ReCaptcha v2, click "CONNECT" and you're in.
If I do this in my browser, it works normally. If I do this in the chromedriver browser controlled by selenium, I get an error. (The error is "please enter the captcha", but that's irrelevant. The server is clearly detecting me because there is a special response coming from the server, triggering this error)
Important: in both cases (my browser and chromedriver browser), I'm doing everything 100% manual! I just use selenium to launch the browser and then proceed from there. I even tried adding an option to the chromedriver browser to use my actual browser settings. It loads with my history, cookies, everything. But when I try to enter the chat room, I get the error.
I also looked online and found some people claiming websites could detect selenium by noticing some specific javascript variable "cdc_". I've edited the hex code of the chromedriver, changed the variable as instructed online, tried again, same result. I spent hours trying to figure this out...
There is one interesting thing that could help find the problem: If I have my browser opened and I try to run the python script with the chromedriver using my profile, the chromedriver browser will start and the python code will return an error saying the profile is already in use (but the browser will remain opened). Now if I try to access the chat room with this chromedriver browser, it works.
EDIT: I've looked at the requests through Fiddler for both cases and the headers are 100% identical! And I mean 100%! Even the sessionid, PHPSESSID and cfuid are the same since it uses the same profile.
The only thing changing is the post request data. More specifically the captcha response (because its a different one) and another variable s. This variable s is somehow calculated using a weird javascript file called challenge. I'm not sure what that could do or how it works.
EDIT: SOLVED I fixed this by adding an option:
options.add_argument("--disable-blink-features=AutomationControlled");