Skip to content

Instantly share code, notes, and snippets.

@aaugustin
Created January 22, 2023 11:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aaugustin/e4eb2ea62ed486162c896bc8082faeb8 to your computer and use it in GitHub Desktop.
Save aaugustin/e4eb2ea62ed486162c896bc8082faeb8 to your computer and use it in GitHub Desktop.
Automate downloading documents from www.credit-agricole.fr
// Pagination is done on the client-side. Remove it.
document.querySelectorAll('tr[id^="ligne"]').forEach(tr => { tr.style.removeProperty("display") });
// There is a 30s mandatory wait between each click. Click one link every 40s.
var delay = 10;
document.querySelectorAll('tr[id^="ligne"] a[href*="ouvreTelechargement"]').forEach(a => {
var tr = a.closest('tr');
if (tr.querySelector('.imgbam-picto-nouveau') !== null) {
setTimeout(() => {
tr.style.setProperty("background-color", "chartreuse");
a.click();
}, delay * 1000);
delay += 40;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment