Open imad-erraiss opened 1 year ago
I'm trying to log in using the same google profile i tried setting the folder but no matter what when I visit chrome://version I get
Profile Path : /tmp/tmpujfywhyh/Default
Here is my code
`import time
from selenium.common.exceptions import WebDriverException from selenium.webdriver.remote.webdriver import By import selenium.webdriver.support.expected_conditions as EC # noqa from selenium.webdriver.support.wait import WebDriverWait from selenium.webdriver.chrome.options import Options
import undetected_chromedriver as uc
options = uc.ChromeOptions()
options.user_data_dir = '/home/john/Work/automated_testing/profiles' driver = uc.Chrome(chrome_options=options, use_subprocess=True) driver.get('chrome://version') time.sleep(15) driver.quit() ~ `
You can try
user_data_dir= r'C:\Users\k3l3vr4\AppData\Local\Google\Chrome\User Data'
driver = uc.Chrome(user_data_dir=user_data_dir,
use_subprocess=True)
But you should mannualy select profile, and it doesn't work if any chrome is already runnng
If i try use profile path ('C:\Users\k3l3vr4\AppData\Local\Google\Chrome\User Data\Profile 1') it creates tmp profile, same for
options.add_argument(r'--profile-directory=Profile 2')
UPD: Fixed, you should copy profile folders somewhere, and use new path, and change 'chrome_options' to 'options'
options = uc.ChromeOptions()
user_data_dir = Path(config.project_path, 'profiles')
options.user_data_dir = user_data_dir
options.add_argument(r'--profile-directory=Profile 2')
driver = uc.Chrome(executable_path=Path(config.profile_path, 'chromedriver.exe'),
options=options)
I'm trying to log in using the same google profile i tried setting the folder but no matter what when I visit chrome://version I get
Profile Path : /tmp/tmpujfywhyh/Default
Here is my code
`import time
from selenium.common.exceptions import WebDriverException from selenium.webdriver.remote.webdriver import By import selenium.webdriver.support.expected_conditions as EC # noqa from selenium.webdriver.support.wait import WebDriverWait from selenium.webdriver.chrome.options import Options
import undetected_chromedriver as uc
options = uc.ChromeOptions()
options.user_data_dir = '/home/john/Work/automated_testing/profiles' driver = uc.Chrome(chrome_options=options, use_subprocess=True) driver.get('chrome://version') time.sleep(15) driver.quit() ~ `