Viventor Agreements Script

Download agreements from Viventor

// ==UserScript==
// @name         Viventor Agreements Script
// @namespace    http://tampermonkey.net/
// @version      0.4
// @description  Download agreements from Viventor
// @author       @Juanvi78
// @match        https://www.viventor.com/profile/investments/myInvestments
// @grant        none
// @require      https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js
// @license MIT
// ==/UserScript==

(function() {
'use strict';
 var $ = window.jQuery, pag=0;
 dwnl();
 function dwnl(){
     if ($(".fa-file-pdf-o").length) {
         $(".fa-file-pdf-o").click();
         if (++pag<$(".module-pagination--page").last().text()) {
             $(".module-pagination--next")[0].click()
             setTimeout(dwnl,10000);
         }
     } else setTimeout(dwnl,1000);
 }
})();