1

Using the code below:

    try:
        with SB(headed=True,uc=True,user_data_dir='path/to/Profile 1',browser='chrome') as sb:
           sb.open('hocalhost:1111')
           sb.sleep(2)
    except:
        print('Some error occur!!')

Expecting to see seleniumbase do the test on the profile i just speciffed. But it just create a new profile under the directory i passed. Info from chrome://version

Profile Path path/to/Profile 1/Default

and do the test there. I've tried to use chromium_arg='--profile-directory='Profile 1' and also not working.

What can i do to solve the problem? Thanks

1 Answers1

0

There are a few things I'm seeing. Looks like you misspelled localhost in your open() line. When using user_data_dir with uc=True, there may be an issue if your user_data_dir contains spaces in the file path (this is especially true if running with PyInstaller). If that didn't help, use either uc or user_data_dir, but not both together, as undetected-chromedriver has multiple open issues with setting the user_data_dir, as seen here: https://github.com/search?q=repo%3Aultrafunkamsterdam%2Fundetected-chromedriver+user_data_dir&type=issues, which includes the issue with the profile directory getting overwritten when setting a custom one: https://github.com/ultrafunkamsterdam/undetected-chromedriver/issues/1232

Michael Mintz
  • 9,007
  • 6
  • 31
  • 48