title: Python Selenium Chrome default directory
body: <p>I've read and tested many solutions but none of them worked. I'm automating tweeter post: I write my tweet, works fine, and then, I click on the Add Pic button ; the windows open file dialog box pops up. I want to change the directory. Here's my actual code:</p>
  <pre><code>options = webdriver.ChromeOptions() 
  options.add_argument(&quot;user-data-dir=C:\\Users\\Jake\\AppData\\Local\\Google\\Chrome\\User Data\\Default&quot;) 
  prefs = {&quot;download.default_directory&quot; : &quot;E:\\Images\\tweeter\\&quot;,&quot;directory_upgrade&quot;: True,&quot;extensions_to_open&quot;: &quot;&quot;}
  options.add_experimental_option(&quot;prefs&quot;,prefs)
  driver = webdriver.Chrome(executable_path='C:\\Program Files (x86)\\chromedriver.exe', chrome_options=options)
  </code></pre>
  <p>Doesn't work.</p>
  <p>Other solution found elsewhere:</p>
  <pre><code>options.add_argument(&quot;download.default_directory=E:\\Images\\tweeter\\&quot;)
  </code></pre>
  <p>Doesn't work.</p>
  <p>Other one:</p>
  <pre><code>prefs = {&quot;profile.default_content_settings.popups&quot;: 0,
               &quot;download.default_directory&quot;: 
                          r&quot;E:\Images\tweeter\\&quot;,#IMPORTANT - ENDING SLASH V IMPORTANT
               &quot;directory_upgrade&quot;: True}
  options.add_experimental_option(&quot;prefs&quot;, prefs)
  </code></pre>
  <p>Doesn't work.</p>
  <p>Any idea?</p>