vivalemuc / FUTBIN - Vivalemuc popular error

// ==UserScript==
// @name        FUTBIN - Vivalemuc popular error
// @version     1.0.0
// @description Error price from popular
// @license     MIT
// @author      Vivalemuc
// @match       https://www.futbin.com/popular

// @grant       none
// ==/UserScript==

(function() {
    'use strict';
    var a = document.createElement('button');
     // Create the text node for anchor element.
    var link = document.createTextNode("1-25");
    // Append the text node to anchor element.
    a.appendChild(link);
    a.setAttribute('onclick','createCsv(0,24);'); // for FF
    a.onclick = function() {createCsv(0,24);}; // for IE
    a.setAttribute('class','btn-csv btn btn-sm btn-primary submit-comment waves-effect waves-light float-right');
    $('.breadcrumb')[0].appendChild(a);

    var a2 = document.createElement('button');
     // Create the text node for anchor element.
    var link2 = document.createTextNode("26-50");
    // Append the text node to anchor element.
    a2.appendChild(link2);
    a2.setAttribute('onclick','createCsv(25,49);'); // for FF
    a2.onclick = function() {createCsv(25,49);}; // for IE
    a2.setAttribute('class','btn-csv btn btn-sm btn-primary submit-comment waves-effect waves-light float-right');
    $('.breadcrumb')[0].appendChild(a2);

 var a3 = document.createElement('button');
     // Create the text node for anchor element.
    var link3 = document.createTextNode("51-75");
    // Append the text node to anchor element.
    a3.appendChild(link3);
    a3.setAttribute('onclick','createCsv(50,74);'); // for FF
    a3.onclick = function() {createCsv(50,74);}; // for IE
    a3.setAttribute('class','btn-csv btn btn-sm btn-primary submit-comment waves-effect waves-light float-right');
    $('.breadcrumb')[0].appendChild(a3);

     var a4 = document.createElement('button');
     // Create the text node for anchor element.
    var link4 = document.createTextNode("76-100");
    // Append the text node to anchor element.
    a4.appendChild(link4);
    a4.setAttribute('onclick','createCsv(75,99);'); // for FF
    a4.onclick = function() {createCsv(75,99);}; // for IE
    a4.setAttribute('class','btn-csv btn btn-sm btn-primary submit-comment waves-effect waves-light float-right');
    $('.breadcrumb')[0].appendChild(a4);


       function createCsv(idx, idx2){
        
        var ids =[];

        var rows = $("li.popular-box").each(function( index ) {
                ids.push($(this)[0].dataset.siteId);
        });

         var futbinIds = ids.slice(idx, idx2);


        var idsString = futbinIds.join(",");

        var link = document.createElement('a');
        link.id = 'getError-'+idx2+'-'+Date.now();

        link.setAttribute('target', '_blank');
        link.setAttribute('href', 'https://vivalemuc.vercel.app/api/error?futbinId='+idsString+'&platform=PS');
        document.body.appendChild(link);
        document.querySelector('#'+link.id).click();

    }

})();