title: How to download files in bulk from browser console using JavaScript?
body: <p>I have no experience with web programming, so my question would be a very simple one. I want to download a lot of files by filling out forms in a web page. The web page's extension is <code>.aspx</code>, and I am interested in only one field and a button. By fooling around with the console in my browser, I figured out that executing:</p>
  <pre><code>document.getElementById('TxtRegNo').value = 'blahblah`;
  </code></pre>
  <p>will fill the concerned field. Also doing a</p>
  <pre><code>__doPostBack(&quot;ImageButton1&quot;,&quot;Click&quot;);
  </code></pre>
  <p>will download the <code>.pdf</code> file curresponding to <code>blahblah</code>. The actual value which needs to be entered is a sequence like PAG-1200 to PAG-1900. I tried using a for loop, like this:</p>
  <pre><code>for (var i = 21618; i &lt; 21621; i++) 
  {
  document.getElementById('TxtRegNo').value = 'B14-' + i;
  __doPostBack(&quot;ImageButton1&quot;,&quot;Click&quot;);
  }
  </code></pre>
  <p>but it doesnot work as expected. only the last document gets downloaded, and I get this in the console:</p>
  <p><img src="https://i.stack.imgur.com/WE7q9.png" alt="enter image description here" /></p>
  <p>Thought this error does not come whe nI run in FireFox's console, I can still run only one file. Could anyone tell me how to do this?</p>