Answer the question
In order to leave comments, you need to log in
How to load default profile in Selenium Chrome?
Hello! I'm trying to load the default VK profile in Selenium so as not to pass authorization
from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
FILE_NAME_PROFILE = r'C:\Users\user_name\AppData\Local\Google\Chrome\User Data\Profile 2'
options = webdriver.ChromeOptions()
options.add_argument("user-data-dir=" + FILE_NAME_PROFILE)
driver = webdriver.Chrome(ChromeDriverManager().install(), chrome_options=options)
driver.get('https://vk.com')
Answer the question
In order to leave comments, you need to log in
user-data-dir is the folder to save all profiles.
https://chromium.googlesource.com/chromium/src.git...
Specifying the path to the folder - load the default profile named Default.
You can load the desired profile by adding this command to the launch options
options.addArguments("profile-directory=Profile 2")
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question