ultrafunkamsterdam / undetected-chromedriver

Custom Selenium Chromedriver | Zero-Config | Passes ALL bot mitigation systems (like Distil / Imperva/ Datadadome / CloudFlare IUAM)
https://github.com/UltrafunkAmsterdam/undetected-chromedriver
GNU General Public License v3.0
9.6k stars 1.14k forks source link

Privacy and Data Tracking on Multi Profiles #548

Open nearlydiffie opened 2 years ago

nearlydiffie commented 2 years ago

Hey ultrafunkamsterdam and all Contributors,

Let's say I have 3 Google Accounts which each has a Profile assigned. The Accounts are logged in (each of them in their own Profile and Browsers) and Sync is activated.

Undetectedchromedriver/Selenium work through the Combination of installed Chrome and the Chromedriverversion. So a real installed Chrome Instance is required for undetectedchromedriver to run. This is clear and works (obviously) flawlessly.

My main question is the following:

Is there any possibility for Google to still detect that those 3 separate Chrome profiles are executed from the same device? If yes, is there a tweak or workaround to make it as hard as possible to detect and still have a "portable" way to use the Profiles like in the Read Me? Which data collects the Main installed Instance of Chrome and which data is only used by the Chromedriver?

Right now (as mentioned) I use the standard way of managing multiple accounts via Path to Profile and generate a new one if needed. My main concern is only that when Google realizes that, they flag the accounts and I have to start all over again.

I HIGHLY appreciate the work and effort you guys put into this. Awesome Project.

Thanks for any help.

ultrafunkamsterdam commented 2 years ago

Is there any possibility for Google to still detect that those 3 separate Chrome profiles are executed from the same device?

if they really need, they'd know.
UC tries to mitigate partly by using a unique binary for each session. so for each driver you start, the script downloads and modifies the binary in place. unfortunately a lot of people complain about a new binary (5 mb or so) for each session but I think they have just a slow connection.

nearlydiffie commented 2 years ago

Thank you so much for your reply!!

if they really need, they'd know. UC tries to mitigate partly by using a unique binary for each session. so for each driver you start, the script downloads and modifies the binary in place.

Is there the option to set the first unique patched binary which UC generates as "standard" only for this specific Profile? This way it would use the unique patched binary for each unique account (Profile) and still would use a "constant binary".

I also noticed a delay in launching the Instances when I use a Profile that has a logged-in account compared to a Profile that has no Account logged in.

The start-up time for Profiles with Accounts increases to a point where it sometimes won't launch and fail with the Error statement "selenium.common.exceptions.WebDriverException: Message: unknown error: cannot connect to chrome at 127.0.0.1:42033 from chrome not reachable".

I still try to reproduce the bug and document it carefully so I can help you find the reason and maybe provide a fix for this.

Again thanks for this awesome repo <3

nearlydiffie commented 2 years ago

Hi, You can set the profile with the following code.

import undetected_chromedriver as uc
from selenium.webdriver.chrome.options import Options as ChromeOptions

chrome_options = ChromeOptions()
chrome_options.add_argument(r'--user-data-dir=C:\Users\Administrator\AppData\Local\Google\Chrome\User Data')
chrome_options.add_argument(f'--profile-directory={profile}')  # profile is one of 'Profile 1', 'Profile 2', etc
driver = uc.Chrome(options=chrome_options)

But this cannot solve the exception you said. If one profile chrome is open, the last line of code throws the same exception. "selenium.common.exceptions.WebDriverException: Message: unknown error: cannot connect to chrome at 127.0.0.1:42033 from chrome not reachable".

If this exception is resolved it will help me too.

You did not get what I am talking about. I already mentioned above that the snippet out of the readme works without any issue.