0

Please don't mark this is as duplicate first read my problem properly..

This is my code:

options = webdriver.ChromeOptions()
options.add_argument(r"--user-data-dir=C:\\Users\\Pranil.DESKTOP-TLQKP4G.000\\AppData\\Local\\Google\\Chrome\\User Data")
options.add_argument(r'--profile-directory=Profile 1')
browser = webdriver.Chrome(ChromeDriverManager().install(), options=options)
browser.get('https://web.whatsapp.com')

And this is the error I get:

selenium.common.exceptions.InvalidArgumentException: Message: invalid argument: user data directory is already in use, please specify a unique value for --user-data-dir argument, or don't use --user-data-dir

I tried the solutions given here: InvalidArgumentException: Message: invalid argument: user data directory is already in use error using --user-data-dir to start Chrome using Selenium

The problem is that the Default and Profile 1 are in the same directory User Data(Creating a new profile doesn't solve the problem as mentioned in above answer)..So if I run this script with my another chrome tab with 'Default' profile running in background this error appears..How can I make sure that this error goes away(I can't close the other chrome tabs with Default profile while running this script)

  • Please check the link https://stackoverflow.com/a/62909989/12870513 – Karthik Sep 12 '20 at 12:53
  • I have already visited that link and I mentioned it in my answer..I want to run instances of chrome with other profile running.I can't close them...Is there any other option? –  Sep 12 '20 at 13:38

0 Answers0