To download all files from the AIUB Portal using the console, you can use a simple script. Here’s how to do it:
- Login to the aiub portal in your browser and go to the section where you wanna download the file. Check the picure below if it's unclear to you
- Press Ctrl+Shift+I OR F12 to open the Developer Tools.
- It’ll open the Sources tab. A marked point will be shown, which you need to add to the ignore list and Refresh the page. Just like in the image below:
- Now, Go to the
Console
tab.
(function() {
window.downloadFile = function(url, name) {
const a = document.createElement('a');
a.href = url;
a.download = name;
a.click();
console.log(name);
};
window.findFiles = function() {
const links = [];
document.querySelectorAll('.col-md-12 .table').forEach(t => {
t.querySelectorAll('tr').forEach(r => {
lc = r.querySelector('td:nth-child(2) a');
if (lc && lc.href) links.push(lc);
})
})
console.log('Yup...Found some files:');
links.forEach((link, i) => {
console.log(`${i+1}. ${link.textContent.trim()} - ${link.href}`);
});
return links;
};
window.downloadAllFiles = function() {
findFiles().forEach((link, i) => {
setTimeout(() => downloadFile(link.href, link.textContent.trim()), i * 100);
});
};
findFiles();
downloadAllFiles();
})();
- The script will automatically find and popup all PDF files linked on the page.
Side note: Please don't post your "fixed" or "improved" versions of the script in the comments. It creates unnecessary confusion, often doesn't fix anything, and sometimes puts other people's accounts at risk. I might redact/delete such comments without notice. Thank you for understanding.