title: How to set the download directory in docker selenium
body: <p>I have an issue.</p>
  <p>The issue is, ı'm developing a project with Python. The project is web scraping. I'm using a selenium library.</p>
  <p>With the Selenium library, I click a button and download the relevant file(xlsx etc).
  Check following sample code:</p>
  <pre><code>    driver = webdriver.Remote('http://selenium:4444/wd/hub', desired_capabilities=DesiredCapabilities.CHROME)
      driver.get(&quot;link&quot;)
      cdate=time.strftime('%Y%m%d')  
      print(cdate)
      while True:
          try:
              wait(driver, 1).until(EC.element_to_be_clickable((By.XPATH, &quot;//span[text()='{}']&quot;.format(cdate)))).click()
              print(&quot;Found, succes!&quot;)
              time.sleep(3)
              break
          except:
              f = '%Y%m%d'
              cdate = (datetime.strptime(cdate, f) - timedelta(days=1)).strftime(f)
              print(&quot;Not match&quot;)
              time.sleep(3)
              print(str(cdate))
  </code></pre>
  <p>When I tried to Dockerize my own code it worked successfully. I entered the relevant place with the code below. I found the downloaded file in the directory below.</p>
  <pre><code>docker exec -it &lt;container name&gt; bash
  cd /Downloads
  ll Sample.xlsx
  </code></pre>
  <p>I need a change download directory. When the docker container up,I want to download it to my own computer. (Like this: c:\Desktop...)</p>
  <p>Docker-Compose.yaml</p>
  <pre><code>    version: '3'
  
  services:
      selenium:
          image: selenium/standalone-chrome
          ports: 
          - 4444:4444
          restart: always
      app:
          build:
              context: .
          volumes: 
          - ./app:/app
          command: sh -c &quot;python3 dev2.py&quot;
          depends_on: 
              - selenium 
  </code></pre>
  <p>Dockerfile:</p>
  <pre><code>FROM python:3.7-alpine
  
  ENV PYTHONUNBUFFERED 1
  ENV DISPLAY=:99
  
  COPY ./requirements.txt /requirements.txt
  RUN pip install -r /requirements.txt
  
  RUN mkdir /app
  COPY ./app /app
  WORKDIR /app
  </code></pre>