Question: I have clicked countless of stackoverflow links similar to my question, but none of the answers is working for me. 

<https://soundoftext.com/>
This site. I'm trying to download several audios at once by pressing each individual download button. Trying to do this in the console for chrome.

```js
$( ".card__actions a:contains('Download')" ).each(function( index ) {
  $(this).click();
});
```

^This seems to return an array. *r.fn.init(X) ...*  

```js
buttons = document.getElementsByClassName('card__action');

 for(var i = 0; i < buttons.length; i++)  
     buttons[i].click();
```

^I tried this too but then it only wants press the last card\_\_action element. 

This is probably super stupid and obvious but I cannot for the life of me figure it out. halp

Answer: 
Creator of Sound of Text here. I think you may have emailed me? 

Any way, here is the javascript that works for me in Chrome. It opens a new tab for each mp3 file:

```
$('.sounds.grid').querySelectorAll('a[download]').forEach(a => window.open(a.href))

```
Try creating new links and clicking them

```
buttons = document.getElementsByClassName('card__action')
function downloadURI(uri, name) 
{
    var link = document.createElement("a")
    link.download = name
    link.href = uri
    setTimeout(()=>{
        link.click()
    },50)
}

for (let i=0;i<buttons.length; i++) {
if (buttons[i].textContent=='Download')
    setTimeout(()=>{
        console.log(`dispatched, ${i}, ${buttons[i].href}`)
        downloadURI(buttons[i].href,buttons[i].href)
    },(i+1)*450)
}

```