title: How to download a file with Puppeteer Sharp?
body: <p>Here is the code that works but it doesn't wait until the completion. How do I make sure the file has been saved?</p>
  <pre><code>    var browser = await Puppeteer.LaunchAsync(new LaunchOptions
      {
          ExecutablePath = &quot;C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe&quot;,
          Headless = false,
      });
      var page = (await browser.PagesAsync()).First();
      page.Response += async (object sender, ResponseCreatedEventArgs e) =&gt;
      {
          if (e.Response.Url.Contains(&quot;.mp4&quot;))
          {
              byte[] buff = await e.Response.BufferAsync();
              File.WriteAllBytes($&quot;{DateTime.UtcNow.ToFileTime()}.mp4&quot;, buff);
          }
      };
      await page.GoToAsync(&quot;https://file-examples-com.github.io/uploads/2017/04/file_example_MP4_480_1_5MG.mp4&quot;);
      await Task.Delay(30000);
  </code></pre>