title: Selenium: Point towards default Chrome session
body: <p>Though I realize it's NOT "good" practice - I have a use case where I need to point (hook up) the Selenium driver to my default Chrome session/profile.</p>
  
  <p>My default profile is here: 
  <code>~/Library/Caches/Google/Chrome/Default</code></p>
  
  <p>Here is how I'm seting it up currently: (not working)</p>
  
  <pre><code>from selenium import webdriver
  
  options = webdriver.ChromeOptions()
  options.add_argument("--user-data-dir=~/Library/Caches/Google/Chrome")
  options.add_argument("--profile-directory=Default")
  browser = webdriver.Chrome(options=options, executable_path=r"./chromedriver")
  browser.get("http://google.com")
  </code></pre>
  
  <p>I'm using Chrome version 74.0.3729.169 and chromedriver version <a href="https://chromedriver.storage.googleapis.com/index.html?path=74.0.3729.6/" rel="noreferrer">ChromeDriver 74.0.3729.6</a> (which is the compatible version). </p>
  
  <p>When Chrome opens I don't see any cookies in Chrome's settings so it's clear it's NOT being pointed to my default session. Also, I see that a <code>Selenium</code> directory has been created (which appears to mean that it has failed to connect to the session at <code>~/Library/Caches/Google/Chrome/Default</code>.</p>
  
  <p>How do I hook up selenium to my default Chrome session? This is the same session as one sees when normally opening up Chrome.</p>
  
  <p>I've looked at this other <a href="https://stackoverflow.com/questions/50635087/how-to-open-a-chrome-profile-through-user-data-dir-argument-of-selenium">question</a>, but the answer there fails to address how to point Selenium towards default session. Also - it's an outdated question - Chrome and Chromedriver have progressed a lot since then. Also, the question there assumes that the poster is able to connect to default session - I am not able to do that which suggests that the Chromedriver/Chrome have changed since then. Also that question is for Windows - I'm on a Mac where things work differently.</p>