Created
November 30, 2024 09:11
-
-
Save maksii/56d7bb5ebc68dfd30683cad7d59a0d34 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
// donwload full page from https://toloka.to/tracker.php?nm= | |
// Function to simulate clicks with a delay | |
async function clickAndDownload() { | |
// Select all anchor elements with the specified class and href pattern | |
const downloadLinks = Array.from(document.querySelectorAll('a.genmed[href^="download.php?id="]')); | |
for (let i = 0; i < downloadLinks.length; i++) { | |
const link = downloadLinks[i]; | |
// Simulate a click on the link | |
link.click(); | |
console.log(`Clicked link ${i + 1} of ${downloadLinks.length}: ${link.href}`); | |
// Wait for 1 second before clicking the next link | |
await new Promise(resolve => setTimeout(resolve, 500)); | |
} | |
console.log("All download links have been clicked."); | |
} | |
// Run the function | |
clickAndDownload(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment