title: How to specify download directory with pupeteer?
body: <p>I'd like to automate the download of some pdf bill in a specific directory but I didn't manage to do it.</p>
  
  <p>Note i'm using puppeteer 3.0.2 on windows:</p>
  
  <p>I tried to setup it multiple ways :
  Initializing the browser:</p>
  
  <pre><code>const browser = await puppeteer.launch({
      headless: navMode,
      userDataDir : "E:/projets/factures/",
      args: [
          '--start-maximized',
          // you can also use '--start-fullscreen'
      ]
  
  });
  </code></pre>
  
  <p>I also tried:</p>
  
  <pre><code>await page._client.send('Page.setDownloadBehavior', {behavior: 'allow', downloadPath: 'E:/projets/factures/'});
  </code></pre>
  
  <p>juste before the download</p>
  
  <p>i tried also :</p>
  
  <pre><code>page.on('request', req =&gt; {
      if (req.url() === urlFile) {
          const file = fs.createWriteStream('./file.pdf');
          https.get(req.url(), response =&gt; response.pipe(file));
      }
  });
  </code></pre>
  
  <p>all of this is before :</p>
  
  <pre><code>await page.goto(urlFile); //urlFile contains the pdf url
  </code></pre>
  
  <p>The PDF is only downloading in the Default Download Directory</p>