title: Is there any way to download csv file from “website button click” using Python?
body: <p>I want to automate the download of a CSV file <code>&quot;Projects.csv&quot;</code> from this website:</p>
  <blockquote>
  <p>https://www.vcsprojectdatabase.org/#/projects/st_/c_/ss_0/so_/di_/np_</p>
  </blockquote>
  <p>The CSV can be downloaded manually by clicking the CSV icon but I'm not sure how can I automate this download in python and store the CSV file locally on my drive.</p>
  <p>So far I have tried inspecting the button element via chrome developer console to find the correct url in the Network tab like so?</p>
  <blockquote>
  <p>https://www.vcsprojectdatabase.org/services/publicViewServices/fetchProjectsExport</p>
  </blockquote>
  <p>But I'm not sure if this URL should include the name of file at the end like this:</p>
  <blockquote>
  <p>https://www.vcsprojectdatabase.org/services/publicViewServices/fetchProjectsExport/Projects.csv</p>
  </blockquote>
  <p>This is what I have tried but it just writes a blank file:</p>
  <pre><code>import requests
  
  url = 'https://www.vcsprojectdatabase.org/services/publicViewServices/fetchProjectsExport/Projects.csv'
  
  r = requests.get(url)
  with open('a.csv', 'wb') as f:
      f.write(r.content) 
  </code></pre>
  <p>How do I get the CSV file to properly download and save?</p>