-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
We need you back Leon! #820
Comments
Is he no longer supporting the project? |
The project is not working properly right now and he usually committed frequently. Edit: Accidentally closed the issue |
Weird - I've been relying on it for a bit and it's working fine for me. |
Using undetected_chromedriver with chrome profiles is broken. For instance, you are not able to control the driver anymore when connected with a profile, but without is fine. |
This is true. When you start the driver, as in the readme, the driver loads the |
This block shows how to do it when it does work:
The problem is the version of Chrome I believe, try an older version, preferably <= 97. Also, Chrome tries very hard to force an update, make sure to disable that. As of right now, I do not have a permanent solution for stopping the updates. |
What version of Chrome are you on? |
106, but not using profiles.
…On Thu, Sep 29, 2022 at 5:00 PM wazoooo ***@***.***> wrote:
Weird - I've been relying on it for a bit and it's working fine for me.
What version of Chrome are you on?
—
Reply to this email directly, view it on GitHub
<#820 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAUEJJHE7OFJTUQ5HBH67XLWAX7OVANCNFSM6AAAAAAQTSSIXI>
.
You are receiving this because you commented.Message ID:
***@***.***
com>
|
Thank you very much for your response! But your answer still doesn't work for me.
not in this: and not in this: Like I said the only thing that works for me:(This ) def driver(profile=str, browser_executable_path=None):
"""
Call driver via undetected_driver;
if you pass profile:
profile: your (Profile num)
else:
driver opens the incognito webpages and deletes cookies.
Then you can use authorization on the YouTube
return: driver
"""
options = uc.ChromeOptions()
if profile:
# match on windows 10
options.add_argument(r"--user-data-dir=C:\Users\Username\AppData\Local\Google\Chrome\User Data")
options.add_argument(f"profile-directory={profile}")
# skip popups
options.add_argument(
'--no-first-run --no-service-autorun --password-store=basic --no-default-browser-check'
)
DRIVER = uc.Chrome(options,
browser_executable_path=browser_executable_path,
version_main=96,
use_subprocess=True)
else:
options.add_argument("--incognito")
DRIVER = uc.Chrome(options,
version_main=96,
use_subprocess=True)
DRIVER.delete_all_cookies()
DRIVER.maximize_window()
return DRIVER
driver("Profile 1", "path_to_chrome.exe") A project "Uploading shorts to YouTube" that I will develop here, but there is no version with profile loading yet. UPD. UPD |
@ArtDanger Thanks for your response! I will try to do some testing regarding stopping the updates using your method. Will it work even if you restart your computer? Once I restarted it kept enabling those services and updated Chrome. |
Then without profiles it should work on any version! |
Sorry @wazoooo, I was wrong. This does not work after rebooting the OS. But it worked: Turn off Microsoft Edge updates. because right after reboot I had google version like microsoft edge. I think they are related.
Thank you for your attention. Do you have any solutions with loading multiple profiles? |
Wazzzaaaaaaaaaaaaaap |
You CAN only work with 1 profile a time, which may not be currently in use. ( also see background processes, and kill them before attempting to use the profile associated with it . This is a limitation of Chrome. Not UC. |
I'm still working on the project, no worries. but i 'm overloaded with issues which aren't actual issues at all but wrong configs and custom plugins which arent even actually supported . Or being blocked by XYZ , and when seeing the code, or no accompanied code at all, i fullly understand they are getting blocked. So i don't even respond to those . |
Guys, I'm stupid, everything is fine. I forgot to write options.add_argument(f"profile-directory={profile}") I fixed the code now it works with multiple profiles in version 96, from the latest version of chrome, I did not check it. def driver(profile=str, browser_executable_path=None):
options = uc.ChromeOptions()
# match on windows 10
options.add_argument(r"--user-data-dir={os.environ['USERPROFILE']}\AppData\Local\Google\Chrome\User Data")
options.add_argument(f"--profile-directory={profile}")
DRIVER = uc.Chrome(options,
browser_executable_path=browser_executable_path,
version_main=96,
use_subprocess=True)
DRIVER.maximize_window()
return DRIVER
driver("Profile 1", "path_to_chrome.exe") Full code implementation here UPD # skip popups
options.add_argument('--no-first-run --no-service-autorun --password-store=basic --no-default-browser-check') removed these lines, read below why. |
still workingI just retested the whole profile thing and working brilliant steps:
at this point, when i want to use this profile in chromedriver , i go like this (below code) import undetected_chromedriver as uc
# the below (colons) is ugly. but when using an interactive interpreter it saves you your fingers
import logging; logging.getLogger().setLevel(10); logger = logging.getLogger('undetected_chromedriver'); logger.setLevel(10); logger.addHandler(logging.FileHandler(filename='chrome.log'))
driver = uc.Chrome(user_data_dir="D:/UC/User Data", debug=True)
driver.get('https://gmail.com') # works fine , no login needed whatsoever
driver.get('https://myaccount.google.com') # works fine, no login required logged in
driver.exit() |
MAN, why is everyone making it so hard for themselves. Just leave the damn uc.ChromeOptions() out, just like those:
This COULD bring your driver in a state where is IS detectable. I did not bake all required options in the code "just for fun"there is a reason behind it. I wanted to be able to pass those silly WAF's. I did not want (and still don't) want to support all kinds of plugins, or functionality which could compromise the stealthness. This project is called undetected_chromedriver and it has 2 missions: 1 - Preventing as much as possible the detections of million-dollar bot-evasion companies. It does a very darn-good job at this. When correctly used (more about that below) 2 - being able to do a simple import ( for instance in an interactive session) and just get going in 1 call. CORRECLY USED ?what does that MEAN? (might some of you think) There are 100s of factors come into play which can cause detection. Including but not limited to
recurring arguments regarding the above i hear a lotbut,but,but when i do regular chrome on same ip it works!yep. that works. well done sherlock. except these regular browser using different fingerprints AND Just keep repeating the bad config/behavior for long enough and you will eventually also start noticing captcha's in your regular browser, visiting your favourite porn site , and that sucks.Bottom lineDon't get me wrong. I know other people have other wishes, use cases and requirements, like plugins or custom configs, which i can fully understand (: hacking. story of my life :). however, taking into account the objectives for this project, raising tickets won't be answered (at least not by me). Some got lucky thanks to the exteremely kind, and helpful @sebdelsol . so you want x,y,z to work or using xyz proxies, plugins - bummer - your problem - fork the repo and make your own adjustments. bottomest line:I just don't have time for issues which aren't really issues
So , that was about it for the rant. @wazoooo @ArtDanger this was not about you. You're sweet ❤️ |
Thank you @ultrafunkamsterdam ! |
One minor thing. You should load the chrome data root directory, and not the folders within, like Profile / default/ or whatsoever |
Got it! |
Thank you! Based on your answer, I made a project that will help those who don't understand. |
Can someone please explain how to log in twitch with undetected driver? Below is my code `import undetected_chromedriver as uc #import wget options = uc.ChromeOptions() #open the webpage #target username #enter username and password #target the login button and click it ` |
Can you add some descriptive text to it, such as the purpose. I am sure those who know totally understand the purpose of the profiles, but if I don't then many others definitely don't either. Thanks. |
Hi, when trying to fetch the driver cookies I'm getting this error
|
this thread is pinned at the issues page, can we remove it from the pinned threads at the top of all issues, or close this @ultrafunkamsterdam leooooon |
I will go ahead and close it. Thanks for the contributions. |
Hi Ultrafunkamsterdam, you have created such a useful tool for thousands of developers around the world. Please consider continuing your project!
The text was updated successfully, but these errors were encountered: