0

I am developing a bot to download a files from a website. The url is example.com/1/download example.com/2/download example.com/3/download

And I create a javascript code like:

i = 0;
while(i <= 100){
    window.open("https://example.com/" + i + "/download", "_blank");
    i++;
}

This works, but I like to close the page after download the file.

Any idea?

Italo Rodrigo
  • 1,555
  • 5
  • 17
  • 38

1 Answers1

0

window.close() will close the current window.`

You can execute a script that will call window.close() after the file is successfully downloaded.

Badmaash
  • 683
  • 7
  • 17