title: Downloading a file from Javascript onclick function in python
body: <p>Suppose i had an anchor tag named "Click to download" on a page which downloads a csv file when clicked </p>
  
  <p>The HTML Code is</p>
  
  <pre><code>&lt;span id="tag_id"&gt;
      &lt;a class="classA" onclick="calling_an_excel_function()" href="#"&gt; Click here to download all records.&lt;/a&gt;
  &lt;/span&gt; 
  </code></pre>
  
  <p>Actually it is calling an Javascript Onclick function and generating a csv file and the code of onclick function is</p>
  
  <pre><code>function calling_an_excel_function() {
      var exampleA = document.getElementById('exampleA.value');
      var exampleB = document.getElementById('exampleB.value');
      var exampleC = document.getElementById('exampleC.value');
      var exampleD = document.getElementById('exampleD.value');
      window.open('indices_main_excel.aspx?ind=' + exampleA.value + '&amp;fromDate=' + exampleB.value + '&amp;toDate=' + examplec.value + '&amp;DMY=' + exampleD.value, '_blank',
  'toolbar=yes,location=no, directories=no, status=no, menubar=yes,scrollbars=yes, resizable=yes ,copyhistory=no, width=800, height=600');
  } 
  </code></pre>
  
  <p>I can expect that in onclick function <strong>window.open()</strong> method is generating a new file with some values given.
  Now i am unable to get <strong>csv</strong> file downloading <strong>url</strong> from the above onclick function 
  Can i know how to get the csv file downloading link </p>