how do i send 250 responses to a button on a website in a single php session?

currently, I am trying to send about 250 "clicks" to a button on a website I dont own.

The website is a "election scam" website, and the point is to send 250 votes in a single php session.

I so far have tried running the vote(); function through console using a for loop in javascript, but I cant seem to get the right syntax to get it to work.

The website's code for each topic that I can vote on is structured as:

<div class="idea special"><b class="name">cr0wn</b> / 174845 Points<div class="vote">
    <div class="agree" onclick="vote(16773, 1)">(I agree)</div> / 
    <div class="disagree" onclick="vote(16773, 0)">(I disagree)</div>
</div><div class="ideaText">cr0wn #1</div></div>

Basically I need to send 250 clicks to the agree class, but I'm not sure how, I also need to do it in the same PHP session, or what im trying to accomplish wont work.

This is the vote function:

function generateRandom (length) {
    var result = '';
    var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
    var charactersLength = characters.length;

    for (var i = 0; i < length; i++)
        result += characters.charAt (Math.floor (Math.random () * charactersLength));

    return result;
}

function vote (id, upvote) {
    var xhttp = new XMLHttpRequest ();
    xhttp.open ("GET", "/vote.php?g=1", false);
    xhttp.send ();
    var work = xhttp.responseText;

    var statusElement = document.getElementById ("status");
    statusElement.className = "status";
    statusElement.innerText = "CPU Voting on Idea #" + id + " ...";

    var found = false;
    while (!found) {
        var randomLength = Math.floor (7 + Math.random () * 18);
        var stringGen = generateRandom (randomLength);
        var md5Gen = md5 ("watch__bisqwit__" + stringGen);

        if (md5Gen.substring (0, work.length).localeCompare (work) === 0) {
            var url = "/vote.php?id=" + id + "&h=" + stringGen;
            if (upvote === 1)
                url += "&u=1";

            xhttp.open ("GET", url, false);
            xhttp.send ();
            found = true;
        }
    }

    location.href = "/";
}

When sending the vote(); function to the console, the page freezes, and it does that on purpose, so I need to find a way to get around it.

Let me know if you need any more information, thanks!