title: How to utilize saved Chrome password to implement an auto-login script, so that I don't have to put plain-text password in the script?
body: <p>The passwords are in my default Chrome profile, which is also what I use for regular browsing. In Selenium, I tried the following</p>
  
  <pre><code>options.add_argument('user-data-dir=/Users/{user}/Library/Application Support/Google/Chrome/')
  </code></pre>
  
  <p>But it complains</p>
  
  <pre><code>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
  </code></pre>
  
  <p>However I need to have a browser with the default <code>--user-data-dir</code> open to do my regular browsing. Is there a way to resolve this conflict, e.g. have my manually-opened session and the Selenium-opened session share a <code>--user-data-dir</code>? Or have the Selenium-opened session attach to my manually-opened session?</p>
  
  <p>If it is not possible, one compromise I could make is to let Selenium use a different <code>--user-data-dir</code>. As a one time work, I can first let Chrome save the passwords for the few websites that I care about. However, it seems that when I use a different <code>--user-data-dir</code>, the opened browser session no longer enables password storing.</p>
  
  <p>I also tried the TestCafe tool, but it also seems to open a non-default profile.</p>