Created
February 4, 2020 03:17
-
-
Save berinhard/0088b09ad967556b4fcef3023a7a3122 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var total = 5; | |
function new_image() { | |
var url = "https://thispersondoesnotexist.com/image"; | |
window.open(url,'_blank'); | |
} | |
function sleep(ms) { | |
return new Promise(resolve => setTimeout(resolve, ms)); | |
} | |
async function crawl_images() { | |
var counter = 0; | |
while (counter < total){ | |
counter++; | |
console.log("Abrindo imagen " + counter + " de " + total); | |
new_image(); | |
await sleep(3000); | |
} | |
console.log("Finalizado!") | |
} | |
crawl_images(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment