WhatsApp Bulk Downloader — Automate Downloading Files

Problem
WhatsApp Web is great, but downloading many files one-by-one is a huge pain. I needed a way to bulk download files from a WhatsApp chat quickly without clicking hundreds of times.
Solution
By inspecting WhatsApp Web’s DOM, I wrote a short JavaScript snippet to automatically click all “Download” buttons for files in the chat, with a delay to avoid freezing the browser.
How It Works
Finds all visible download buttons using CSS selectors.
Clicks each button sequentially with a 1.5-second delay.
Lets the browser handle downloads automatically.
Code Snippet
const downloadButtons = Array.from(document.querySelectorAll('div[role="button"][title^="Download"]'));
console.log("Found", downloadButtons.length, "downloadable files");
downloadButtons.forEach((btn, i) => {
setTimeout(() => {
console.log("Clicking:", btn.title);
btn.click();
}, i * 1500);
});
What I Learned
Inspecting the DOM is crucial for web automation.
Adding delays prevents crashes or browser overload.
JavaScript console scripts are a quick and powerful automation tool.
Github Repo
https://github.com/MachangDoniel/Mini-Projects/tree/main/Whatsapp-Bulk-Downloader
Subscribe to my newsletter
Read articles from Doniel Tripura directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
